Skip to content

Commit

Permalink
pythongh-122245: Add test case of generic type with __debug__
Browse files Browse the repository at this point in the history
  • Loading branch information
iritkatriel committed Jul 26, 2024
1 parent bc94cf7 commit 51eead9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
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).

0 comments on commit 51eead9

Please sign in to comment.