Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Lib/test/test_syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -2265,6 +2265,10 @@ def f(x: *b)
Traceback (most recent call last):
SyntaxError: cannot assign to __debug__

>>> class A[__debug__]: pass
Traceback (most recent call last):
SyntaxError: cannot assign to __debug__

>>> class A[T]((x := 3)): ...
Traceback (most recent call last):
...
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +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
stage to the symtable. This means that these errors are now detected even in
code that is optimized away before codegen (such as assertions with the
:option:`-O` command line option.)
:option:`-O` command line option).