[Python-Dev] Normalisation of unicode and keywords
Steve Holden
steve at holdenweb.com
Fri May 18 12:19:41 EDT 2018
More information about the Python-Dev mailing list
Fri May 18 12:19:41 EDT 2018
- Previous message (by thread): [Python-Dev] Normalisation of unicode and keywords
- Next message (by thread): [Python-Dev] please help triage VSTS failures
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
It's a canonicalisation error. Steve Holden On Fri, May 18, 2018 at 2:38 PM, Ivan Pozdeev via Python-Dev < python-dev at python.org> wrote: > On 18.05.2018 14:46, Steven D'Aprano wrote: > >> Stephan Houben noticed that Python apparently allows identifiers to be >> keywords, if you use Unicode "mathematical bold" letters. His >> explanation is that the identifier is normalised, but not until after >> keywords are checked for. So this works: >> >> class Spam: >> locals()['if'] = 1 >> >> >> Spam.𝐢𝐟 # U+1D422 U+1D41F >> # returns 1 >> >> >> Of course Spam.if fails with SyntaxError. >> >> Should this work? Is this a bug, a feature, or an accident of >> implementation we can ignore? >> > Voting for bug: > Either those identifiers should be considered equal, or they shouldn't. > They can't be considered "partially" equal. > >> >> >> > -- > Regards, > Ivan > > > _______________________________________________ > Python-Dev mailing list > Python-Dev at python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: https://mail.python.org/mailman/options/python-dev/steve% > 40holdenweb.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20180518/84d34f67/attachment.html>
- Previous message (by thread): [Python-Dev] Normalisation of unicode and keywords
- Next message (by thread): [Python-Dev] please help triage VSTS failures
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list