Message336100
All ways of assigning to __debug__ are forbidden:
>>> __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__
The only exception is the assignment operator.
>>> (__debug__ := 'spam')
'spam'
>>> globals()['__debug__']
'spam'
This looks like a bug. |
|
Date |
User |
Action |
Args |
2019-02-20 15:23:36 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, gvanrossum, emilyemorehouse |
2019-02-20 15:23:36 | serhiy.storchaka | set | messageid: <1550676216.29.0.487544148429.issue36052@roundup.psfhosted.org> |
2019-02-20 15:23:36 | serhiy.storchaka | link | issue36052 messages |
2019-02-20 15:23:36 | serhiy.storchaka | create | |
|