New submission from Carl Friedrich Bolz-Tereick <cfb...@gmx.de>:

Right now, deleting __debug__ is not prevented:

>>> def f():
...     del __debug__
... 

Of course actually executing it doesn't work:

>>> del __debug__
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name '__debug__' is not defined


Compare with assigning to __debug__:

>>> def f():
...     __debug__ = 1
... 
  File "<stdin>", line 2
SyntaxError: cannot assign to __debug__

----------
messages: 406149
nosy: Carl.Friedrich.Bolz
priority: normal
severity: normal
status: open
title: Deleting __debug__ should be an SyntaxError

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45781>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to