Message412084
The way Python 3 handles identifiers containing mathematical characters appears to be broken. I didn't test the entire range of U+1D400 through U+1D59F but I spot-checked them and the bug manifests itself there:
Python 3.9.7 (default, Sep 10 2021, 14:59:43)
[GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> foo = 1234567890
>>> bar = 1234567890
>>> foo is bar
False
>>> 𝖇𝖆𝖗 = 1234567890
>>> foo is 𝖇𝖆𝖗
False
>>> bar is 𝖇𝖆𝖗
True
>>> 𝖇𝖆𝖗 = 0
>>> bar
0
This differs from the behavior with other non-ASCII characters. For example, ASCII 'a' and Cyrillic 'a' are properly treated as different identifiers:
>>> а = 987654321 # Cyrillic lowercase 'a', U+0430
>>> a = 123456789 # ASCII 'a'
>>> а # Cyrillic
987654321
>>> a # ASCII
123456789
While a bit of a pathological case, it is a nasty surprise. It's possible this is a symptom of a larger bug in the way identifiers are resolved.
This is similar but not identical to https://bugs.python.org/issue46555
Note: I did not find this myself; I give credit to Cooper Stimson (https://github.com/6C1) for finding this bug. I merely reported it. |
|
Date |
User |
Action |
Args |
2022-01-29 17:06:08 | da | set | recipients:
+ da, vstinner, ezio.melotti, lys.nikolaou, pablogsal |
2022-01-29 17:06:08 | da | set | messageid: <1643475968.35.0.473325174719.issue46572@roundup.psfhosted.org> |
2022-01-29 17:06:08 | da | link | issue46572 messages |
2022-01-29 17:06:08 | da | create | |
|