Ned Deily <n...@acm.org> added the comment:

Serhiy, I don't know why Misc.Tk is not module level but it isn't so caching 
global attributes there isn't effective.  However, upon further consideration, 
I take back my original suggestion of caching at the module level primarily 
because I can think of future scenarios where it might be possible that there 
are different windowing systems supported in the same Python instance.  I now 
think the best solution is to cache at the Tk root object level; that appears 
to be a simple change to Thomas's 2nd revision.  Sorry about that!  Here is a 
fourth version (one for 3.x and one for 2.7) based on the second which includes 
the fix from the 3rd.

I started to write a simple test for the clipboard functions but then realized 
that there doesn't seem to be a practical way to effectively test in a 
machine-independent way without destroying the contents of the Tk clipboard and 
hence the user's desktop clipboard, not a friendly thing to do.  For example, 
the clipboard might contain a data type not supported by the platform's Tk, 
like pict data on OS X.  So I'm not including the test here but it did verify 
that the attribute was being properly cached across multiple tkinter objects.

Thanks to Thomas for the patch and to Serhiy for reviewing.  By the way, 
Thomas, for your patch to be included, you should submit a PSF contributor 
agreement as described here:  http://www.python.org/psf/contrib/.  Once that is 
in place and if the patch looks good to everyone, I'll apply it.

----------
stage:  -> patch review
Added file: http://bugs.python.org/file25571/x11-clipboard-try-utf8-4.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14777>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to