Skip to content

Commit d791b98

Browse files
authored
gh-122245: Add test case of generic type with __debug__ (#122322)
1 parent 1ca99ed commit d791b98

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Lib/test/test_syntax.py

+4
Original file line numberDiff line numberDiff line change
@@ -2265,6 +2265,10 @@ def f(x: *b)
22652265
Traceback (most recent call last):
22662266
SyntaxError: cannot assign to __debug__
22672267
2268+
>>> class A[__debug__]: pass
2269+
Traceback (most recent call last):
2270+
SyntaxError: cannot assign to __debug__
2271+
22682272
>>> class A[T]((x := 3)): ...
22692273
Traceback (most recent call last):
22702274
...
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Detection of writes to ``__debug__`` is moved from the compiler's codegen
2-
stage to the symtable. This means that these errors now detected even in
2+
stage to the symtable. This means that these errors are now detected even in
33
code that is optimized away before codegen (such as assertions with the
4-
:option:`-O` command line option.)
4+
:option:`-O` command line option).

0 commit comments

Comments
 (0)