A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2018-May/153619.html below:

[Python-Dev] Normalisation of unicode and keywords

[Python-Dev] Normalisation of unicode and keywords [Python-Dev] Normalisation of unicode and keywordsSteven D'Aprano steve at pearwood.info
Fri May 18 07:46:11 EDT 2018
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?



-- 
Steve
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4