[issue45781] Deleting __debug__ should be an SyntaxError

2021-11-13 Thread Carl Friedrich Bolz-Tereick
Carl Friedrich Bolz-Tereick added the comment: ouch, apologies for not checking that! -- ___ Python tracker ___ ___

[issue45781] Deleting __debug__ should be an SyntaxError

2021-11-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: Verified in IDLE also. Thanks for doing the test I should have done. -- resolution: -> out of date stage: test needed -> resolved status: open -> closed ___ Python tracker

[issue45781] Deleting __debug__ should be an SyntaxError

2021-11-12 Thread Andre Roberge
Andre Roberge added the comment: What version are you using? As far as I can test, it has become a syntax error since 3.10. Here is the result with the latest 3.11 alpha > python Python 3.11.0a2 (tags/v3.11.0a2:e2b4e4b, Nov 5 2021, 20:00:05) [MSC v.1929 64 bit (AMD64)] on win32 Type

[issue45781] Deleting __debug__ should be an SyntaxError

2021-11-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: For comparison: True = 0 SyntaxError: cannot assign to True del True SyntaxError: cannot delete True It almost seems like __debug__ is a hidden keyword value, but with a startup-dependent value -- components: +Interpreter Core nosy: +pablogsal,

[issue45781] Deleting __debug__ should be an SyntaxError

2021-11-11 Thread Carl Friedrich Bolz-Tereick
New submission from Carl Friedrich Bolz-Tereick : 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 "", line 1, in NameError: name '__debug__' is