FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-122245: move checks for writes and shadowing of __debug__ to symtable by iritkatriel · Pull Request #122246 · python/cpython · GitHub

/ cpython Public

gh-122245: move checks for writes and shadowing of __debug__ to symtable - #122246

Merged
iritkatriel merged 8 commits into
python:mainfrom
iritkatriel:debug_check
Jul 26, 2024
Merged

gh-122245: move checks for writes and shadowing of __debug__ to symtable#122246
iritkatriel merged 8 commits into
python:mainfrom
iritkatriel:debug_check

Conversation

iritkatriel commented Jul 24, 2024
edited
Loading

Copy link
Copy Markdown
Member

iritkatriel requested a review from jeremyhylton July 24, 2024 21:59

markshannon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks good.

Comment thread Python/symtable.c Outdated
Comment thread Python/symtable.c Outdated
Comment thread Python/symtable.c Outdated
Comment thread Python/symtable.c Outdated
iritkatriel merged commit bc94cf7 into python:main Jul 26, 2024

JelleZijlstra left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I started a review but never submitted it, sorry. None of these suggested changes seem crucial, but consider adding them if you like.

Comment thread Lib/test/test_syntax.py
Comment on lines +2264 to +2267
>>> type __debug__ = int
Traceback (most recent call last):
SyntaxError: cannot assign to __debug__

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
>>> 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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
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.)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
:option:`-O` command line option.)
:option:`-O` command line option).

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move detection of writes and shadowing of __debug__ from compiler to symtable.

3 participants


Back | FazBrowse Home | New Git URL