Message383336
This behavior is best described by the code below:
```
>>> meow = 1
>>> 'meow' in globals()
True
>>> µmeow = 1e-6
>>> 'µmeow' in globals()
False
>>> globals()['woof'] = 1
>>> woof
1
>>> globals()['µwoof'] = 1e-6
>>> µwoof
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'μwoof' is not defined
>>> import sys
>>> sys.getdefaultencoding()
'utf-8'
>>> [(k, bytes(k, 'utf-8')) for k in globals()]
..., ('μmeow', b'\xce\xbcmeow'), ('µwoof', b'\xc2\xb5woof')]
>>> 'µ'.encode('utf-8')
b'\xc2\xb5'
```
Testing was done on linux and windows, variously using 3.6.12, 3.7.6, 3.8.6 and 3.9.0+. |
|
Date |
User |
Action |
Args |
2020-12-19 00:27:18 | outofculture | set | recipients:
+ outofculture, vstinner, ezio.melotti |
2020-12-19 00:27:18 | outofculture | set | messageid: <1608337638.31.0.282266859185.issue42680@roundup.psfhosted.org> |
2020-12-19 00:27:18 | outofculture | link | issue42680 messages |
2020-12-19 00:27:17 | outofculture | create | |
|