Repository navigation
Closed
Labels
3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = None
closed_at = <Date 2021-08-26.09:52:32.700>
created_at = <Date 2021-08-25.11:50:39.044>
labels = ['interpreter-core', 'type-bug', '3.10', '3.11']
title = 'del __debug__ should be a SyntaxError'
updated_at = <Date 2021-08-26.09:52:32.699>
user = 'https://github.com/aroberge'bugs.python.org fields:
activity = <Date 2021-08-26.09:52:32.699>
actor = 'pablogsal'
assignee = 'none'
closed = True
closed_date = <Date 2021-08-26.09:52:32.700>
closer = 'pablogsal'
components = ['Parser']
creation = <Date 2021-08-25.11:50:39.044>
creator = 'aroberge'
dependencies = []
files = []
hgrepos = []
issue_num = 45000
keywords = ['patch']
message_count = 5.0
messages = ['400256', '400277', '400302', '400331', '400332']
nosy_count = 5.0
nosy_names = ['aroberge', 'corona10', 'lys.nikolaou', 'pablogsal', 'miss-islington']
pr_nums = ['27947', '27956', '27957', '27958']
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue45000'
versions = ['Python 3.10', 'Python 3.11']Metadata
Metadata
Assignees
Labels
3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Activity
aroberge commentedon Aug 25, 2021
Consider the following:
I suggest that attempting to delete __debug__ should be a SyntaxError, similar to attempting to delete None and other constants.
= = =
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.
miss-islington commentedon Aug 25, 2021
New changeset 551da59 by Dong-hee Na in branch 'main':
bpo-45000: Raise SyntaxError when try to delete __debug__ (GH-27947)
551da59
corona10 commentedon Aug 26, 2021
New changeset c764dfb by Dong-hee Na in branch 'main':
bpo-45000: Update whatsnews about deleting __debug__ (GH-27956)
c764dfb
pablogsal commentedon Aug 26, 2021
New changeset 6ea6cf2 by Dong-hee Na in branch '3.10':
[3.10] bpo-45000: Update whatsnews about deleting __debug__ (GH-27956) (GH-27958)
6ea6cf2
pablogsal commentedon Aug 26, 2021
New changeset 32c1caa by Dong-hee Na in branch '3.10':
bpo-45000: Raise SyntaxError when try to delete __debug__ (GH-27947) (GH-27957)
32c1caa
[syntax-errors] Store to or delete `__debug__`
[syntax-errors] Store to or delete `__debug__` (#16984)
[syntax-errors] Store to or delete `__debug__` (#16984)