-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-122245: move checks for writes and shadowing of __debug__ to symtable #122246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started a review but never submitted it, sorry. None of these suggested changes seem crucial, but consider adding them if you like.
>>> type __debug__ = int | ||
Traceback (most recent call last): | ||
SyntaxError: cannot assign to __debug__ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
>>> type __debug__ = int | |
Traceback (most recent call last): | |
SyntaxError: cannot assign to __debug__ | |
>>> type __debug__ = int | |
Traceback (most recent call last): | |
SyntaxError: cannot assign to __debug__ | |
>>> class A[__debug__]: pass | |
Traceback (most recent call last): | |
SyntaxError: cannot assign to __debug__ | |
In a similar vein
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, should have waited a bit longer. I'll add this.
@@ -0,0 +1,4 @@ | |||
Detection of writes to ``__debug__`` is moved from the compiler's codegen | |||
stage to the symtable. This means that these errors now detected even in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stage to the symtable. This means that these errors now detected even in | |
stage to the symtable. This means that these errors are now detected even in |
Detection of writes to ``__debug__`` is moved from the compiler's codegen | ||
stage to the symtable. This means that these errors now detected even in | ||
code that is optimized away before codegen (such as assertions with the | ||
:option:`-O` command line option.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:option:`-O` command line option.) | |
:option:`-O` command line option). |
Fixes #122245.