mirror of
https://github.com/python/cpython.git
synced 2025-08-28 20:56:54 +00:00
gh-110938: Fix error messages for indented blocks with functions and classes with generic type parameters (#110973)
This commit is contained in:
parent
be5e8a0103
commit
24e4ec7766
4 changed files with 46 additions and 22 deletions
|
@ -1446,11 +1446,21 @@ Specialized indentation errors:
|
|||
Traceback (most recent call last):
|
||||
IndentationError: expected an indented block after function definition on line 1
|
||||
|
||||
>>> def foo[T](x, /, y, *, z=2):
|
||||
... pass
|
||||
Traceback (most recent call last):
|
||||
IndentationError: expected an indented block after function definition on line 1
|
||||
|
||||
>>> class Blech(A):
|
||||
... pass
|
||||
Traceback (most recent call last):
|
||||
IndentationError: expected an indented block after class definition on line 1
|
||||
|
||||
>>> class Blech[T](A):
|
||||
... pass
|
||||
Traceback (most recent call last):
|
||||
IndentationError: expected an indented block after class definition on line 1
|
||||
|
||||
>>> match something:
|
||||
... pass
|
||||
Traceback (most recent call last):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue