This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author aroberge
Recipients aroberge, lys.nikolaou, pablogsal
Date 2021-08-25.11:50:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1629892239.06.0.814247211414.issue45000@roundup.psfhosted.org>
In-reply-to
Content
Consider the following:

Python 3.10.0rc1  ...
>>> __debug__
True
>>> del __debug__
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name '__debug__' is not defined
>>> __debug__
True
>>> __debug__ = False
  File "<stdin>", line 1
SyntaxError: cannot assign to __debug__

I suggest that attempting to delete __debug__ should be a SyntaxError, similar to attempting to delete None and other constants.

>>> del None
  File "<stdin>", line 1
    del None
        ^^^^
SyntaxError: cannot delete None

= = =
The same NameError exception is raised for Python 3.9 when attempting to delete __debug__.  For Python 3.8, attempting to delete __debug__ silently fails, so the current behaviour is at least an improvement.
History
Date User Action Args
2021-08-25 11:50:39arobergesetrecipients: + aroberge, lys.nikolaou, pablogsal
2021-08-25 11:50:39arobergesetmessageid: <1629892239.06.0.814247211414.issue45000@roundup.psfhosted.org>
2021-08-25 11:50:39arobergelinkissue45000 messages
2021-08-25 11:50:38arobergecreate