Does Python forbid two similarly looking Unicode identifiers?
Here's a small example, just to show how horrible this "feature" is:
ðð¡ᵢð°_fð¢ð¢ððᵣₑ_ð¤ₕð¬ð²ðð¡_dₑðᵢð¯iðµðℓy_ð·ð¦_ð_ðᵘg = 42
print(Tðµℹð_ðeðððªᵣe_ₛð¥ºð¾ð¹ð_ðeðᵢðⁱtᵉðð_ð»ℯ_ð_ððð°)
# => 42
Try it online! (But please don't use it)
And as mentioned by @MarkMeyer, two identifiers might be distinct even though they look just the same ("CYRILLIC CAPITAL LETTER A" and "LATIN CAPITAL LETTER A")
А = 42
print(A)
# => NameError: name 'A' is not defined
PEP 3131 -- Supporting Non-ASCII Identifiers says
All identifiers are converted into the normal form NFKC while parsing; comparison of identifiers is based on NFKC.
You can use unicodedata
to test the conversions:
import unicodedata
unicodedata.normalize('NFKC', 'ð')
# f
which would indicate that 'ð'
gets converted to 'f'
in parsing. Leading to the expected:
ð = "Some String"
print(f)
# "Some String"