Terry J. Reedy <tjre...@udel.edu> added the comment:

AFAIK, the big new feature of tcl/tk 9.0 is intended to be full unicode 
support.  We can hope that 9.0 appears in time to be included in the 3.8 
installers.

Until then, I think filenames, user program output, and clipboard content 
should be checked for the presence of astral characters before being sent to a 
tk widget. For this issue, that means replacing the built-in <<Paste>> handler. 
 Replace astral chars with \U000nnnn escapes.  If the widget it a Text, tag the 
escape as 'Astral' and color it with the code context colors to distinguish it 
from escapes originally in the string.

Strings know their kind, but a request to expose that has been rejected.  
Pyshell currently compares the max codepoint to 'ffff'.  But it appears that we 
can detect kind with an O(1) expression.  For 3.6 and 3.7, "sys.getsizeof(s) == 
76 + len(s)".  For 3.8, "sys.getsizeof(s) == 48 + len(s)".  Does anyone know 
why the difference?

----------

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

Reply via email to