Message336099
__debug__ is not a keyword. And the error message has been changed in 3.8.
But it is a special enough. You can not use this name in any assignment context:
>>> __debug__ = 1
File "<stdin>", line 1
SyntaxError: cannot assign to __debug__
>>> for __debug__ in []: pass
...
File "<stdin>", line 1
SyntaxError: cannot assign to __debug__
>>> with cm() as __debug__: pass
...
File "<stdin>", line 1
SyntaxError: cannot assign to __debug__
>>> class __debug__: pass
...
File "<stdin>", line 1
SyntaxError: cannot assign to __debug__
>>> def __debug__(): pass
...
File "<stdin>", line 1
SyntaxError: cannot assign to __debug__
>>> def foo(__debug__): pass
...
File "<stdin>", line 1
SyntaxError: cannot assign to __debug__
>>> import __debug__
File "<stdin>", line 1
SyntaxError: cannot assign to __debug__
You can not even assign to an attribute named __debug__!
>>> x.__debug__ = 1
File "<stdin>", line 1
SyntaxError: cannot assign to __debug__
The assignment operator is the only exception here, and this looks like a bug. |
|
Date |
User |
Action |
Args |
2019-02-20 15:18:59 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, r.david.murray, docs@python, matrixise, jfine2358 |
2019-02-20 15:18:58 | serhiy.storchaka | set | messageid: <1550675938.99.0.0120479234941.issue34464@roundup.psfhosted.org> |
2019-02-20 15:18:58 | serhiy.storchaka | link | issue34464 messages |
2019-02-20 15:18:58 | serhiy.storchaka | create | |
|