Re: [Python-Dev] Normalisation of unicode and keywords

2018-05-18 Thread Steve Holden
It's a canonicalisation error. Steve Holden On Fri, May 18, 2018 at 2:38 PM, Ivan Pozdeev via Python-Dev < python-dev@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 "math

Re: [Python-Dev] Normalisation of unicode and keywords

2018-05-18 Thread Ivan Pozdeev via Python-Dev
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 Sp

[Python-Dev] Normalisation of unicode and keywords

2018-05-18 Thread Steven D'Aprano
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