Author terry.reedy
Recipients Ben Griffin, epaine, ned.deily, ronaldoussoren, terry.reedy
Date 2020-07-11.01:44:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Python internally uses an encoding system that represents all unicode chars efficiently, including O(1) indexing.  It is not utf-8, which does not do O(1) indexing.

There is already an issue about upgrading (separately) the Python Windows and macOS installers to install tcl/tk 8.6.9.

With the currrent 8.6.9 and probably earlier, and since an important tkinter patch last fall for #13153, a tkinter/tk text widget will display astral characters that the font in use can produce.  For example, in 3.9.0, I see the TV set printed in IDLE
>>> '\U0001f4bb'
but not in the Windows Console Python REPL, which shows 'box space box box'.

However, astral characters discombobutate editing (#39126),at least on Windows, they are counted as 2 or 4 chars.  The difference between behavior before and after Serhiy's patch and between display and editing likely explains different reports on SO.
Date User Action Args
2020-07-11 01:44:58terry.reedysetrecipients: + terry.reedy, ronaldoussoren, ned.deily, Ben Griffin, epaine
2020-07-11 01:44:57terry.reedysetmessageid: <>
2020-07-11 01:44:57terry.reedylinkissue41212 messages
2020-07-11 01:44:56terry.reedycreate