Fix incorrect placement of leading function comment with type params (#12447)

This commit is contained in:
Micha Reiser 2024-07-22 14:17:00 +02:00 committed by GitHub
parent 3ace12943e
commit ed238e0c76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 141 additions and 4 deletions

View file

@ -224,3 +224,25 @@ class QuerySet(AltersData):
as_manager.queryset_only = True
as_manager = classmethod(as_manager)
# Decorators
@decorator
# comment
class Foo1: ...
@decorator
# comment
class Foo2(Foo1): ...
@decorator
# comment
class Foo3[T]: ...
@decorator # comment
class Foo4: ...
@decorator
# comment
@decorato2
class Foo5: ...

View file

@ -436,3 +436,25 @@ def function_with_variadic_generics(*args: *tuple[int],): ...
# Generic arguments (PEP 695)
def func[T](lotsoflongargs: T, lotsoflongargs2: T, lotsoflongargs3: T, lotsoflongargs4: T, lotsoflongargs5: T) -> T: ...
# Decorators
@decorator
# comment
def foo[S](x: S) -> S: ...
@decorator
# comment
def foo(x: S) -> S: ...
@decorator
# comment
def foo() -> S: ...
@decorator
# comment
@decorator2
def foo(x: S) -> S: ...
@decorator # comment
def foo(x: S) -> S: ...