You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unicode is normalised after keywords are checked for #77886
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2018-05-31.04:53:08.938>labels= ['interpreter-core', 'type-bug', 'expert-unicode']
title='Unicode is normalised after keywords are checked for'updated_at=<Date2018-05-31.04:54:23.515>user='https://github.com/stevendaprano'
Activity
stevendaprano commentedon May 31, 2018
There is a loophole in the Unicode normalisation which allows the creation of names matching keywords.
Spam.𝐢𝐟 # U+1D422 U+1D41F
# returns 1
Those two characters are 'MATHEMATICAL BOLD SMALL I' and 'MATHEMATICAL BOLD SMALL F'. They ought to be normalised to "if", which is a keyword.
Of course Spam.if is a syntax error, and I believe Spam.𝐢𝐟 ought to be as well.
Another example:
py> globals()['for'] = 2
py> 𝐟or
2
I also asked about this here:
https://mail.python.org/pipermail/python-dev/2018-May/153619.html
stevendaprano commentedon May 31, 2018
Possibly the correct term is canonicalisation rather than normalisation, although I think the two are interchangeable.
StanFromIreland commentedon Sep 26, 2025
In #86846 it was concluded this is a docs issue, closing as duplicate.