2018-05-18 13:37 GMT+02:00 Steven D'Aprano <st...@pearwood.info>: > On Fri, May 18, 2018 at 11:17:13AM +0200, Stephan Houben wrote: > > > And the alternative is to replace all occurrences of > > spam with 𝐬𝐩𝐚𝐦 , which has the same effect and also is > > backward-compatible with 3.x for x < 8. > > > > So there is already a kind of solution available, albeit an ugly one. > > You are kidding, I hope. >
I am not kidding; I am merely defending the status quo. I demonstrate how the intended behavior can be achieved using features available in current Python versions. The approach has at least the following two technical advantages. 1. It requires no change to Python 2. It provides backwards compatibility all the way back to 3.0. The spelling is arguably ugly, but this should be weighted against the, IMHO, extremely rare use of this feature. > > If that works at all, I don't think its something we want to guarantee > will work. It is guaranteed to work by PEP-3131: https://www.python.org/dev/peps/pep-3131 "All identifiers are converted into the normal form NFKC while parsing; comparison of identifiers is based on NFKC." NFKC normalization means spam must be considered the same identifier as 𝐬𝐩𝐚𝐦 . Note that the choice for NFKC normalization was apparently explicitly discussed and decided upon at the time. Since the difference between NFC and NFKC is exactly that identifiers like spam and 𝐬𝐩𝐚𝐦 are different under the former and identical under the latter, I take it this is all quite intentional. > And for what it's worth, what I see is eight empty boxes > (missing glyph symbols). > > I am afraid that mostly shows that your mailer has a bug in handling non-BMP unicode characters; you should be seeing FOUR missing glyph symbols. Stephan > > -- > Steve > _______________________________________________ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ >
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/