Message412078
(Hilariously, I couldn't post this comment on bugs.python.org due to some kind of Unicode bug ("Edit Error: 'utf8' codec can't decode bytes in position 208-210: invalid continuation byte"), so I've rendered "\U0001D555\U0001D556\U0001D557" as "DEF" in the below.)
Thanks for clarifying the terminology re: reserved words vs. keywords.
> The effect is the same as "globals()['DEF']=1" (which is the same as
> passing 'def' or anything else that normalizes to it) and that in
> turn allows ">>> DEF", which returns 1.
This doesn't quite seem to be the case, at least on Pythons 3.9 and 3.10:
>>> globals()['DEF']=1
>>> DEF
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'def' is not defined
>>> globals()['def']=1
>>> DEF
1
It looks the dictionary interface to `globals` doesn't normalize like the parser does. |
|
Date |
User |
Action |
Args |
2022-01-29 15:26:02 | Kodiologist | set | recipients:
+ Kodiologist, terry.reedy, benjamin.peterson, JelleZijlstra, pablogsal, BTaskaya, sobolevn |
2022-01-29 15:26:02 | Kodiologist | set | messageid: <1643469962.44.0.485458201403.issue46520@roundup.psfhosted.org> |
2022-01-29 15:26:02 | Kodiologist | link | issue46520 messages |
2022-01-29 15:26:02 | Kodiologist | create | |
|