Bug report
Bug description:
The CPython interpreter appears to apply some form of unicode normalization to variable names, but not to strings, leading to surprising errors as demonstrated in the following code. Though the code contains only the combination d, U+0307 (COMBINING DOT ABOVE) to form a dotted ḋ, some of these get altered to U+1E0B (LATIN SMALL LETTER D WITH DOT ABOVE) resulting in key and type errors. Is this behaviour as intended?
good_dict = {'ḋ': 1}
# {'ḋ': 1} <--- not changed
good_dict['ḋ']
# ok
bad_dict = dict(ḋ = 1)
# {'ḋ': 1} <--- changed
#bad_dict['ḋ'] # uncomment to trigger error
# KeyError: 'ḋ'
def f(ḋ):
print(ḋ)
f(ḋ=1)
# ok
#f(**good_dict) # uncomment to trigger error
# TypeError: f() got an unexpected keyword argument 'ḋ'
f(**bad_dict)
# ok
CPython versions tested on:
3.13, 3.14, 3.12, 3.11
Operating systems tested on:
Linux
Bug report
Bug description:
The CPython interpreter appears to apply some form of unicode normalization to variable names, but not to strings, leading to surprising errors as demonstrated in the following code. Though the code contains only the combination d, U+0307 (COMBINING DOT ABOVE) to form a dotted ḋ, some of these get altered to U+1E0B (LATIN SMALL LETTER D WITH DOT ABOVE) resulting in key and type errors. Is this behaviour as intended?
CPython versions tested on:
3.13, 3.14, 3.12, 3.11
Operating systems tested on:
Linux