Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return annotation brackets #2990

Merged
merged 12 commits into from Apr 9, 2022
37 changes: 37 additions & 0 deletions tests/data/return_annotation_brackets.py
Expand Up @@ -53,6 +53,27 @@ def foo(a: int, b: int, c: int,) -> intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasd
def foo(a: int, b: int, c: int,) -> int:
return 2

# Deeply nested brackets
# with *interesting* spacing
jpy-git marked this conversation as resolved.
Show resolved Hide resolved
def double(a: int) -> (((((int))))):
return 2*a

def double(a: int) -> (
( (
((int)
)
)
)
):
return 2*a

def foo() -> (
( (
intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds
)
)):
return 2

# output
# Control
def double(a: int) -> int:
Expand Down Expand Up @@ -132,3 +153,19 @@ def foo(
c: int,
) -> int:
return 2


# Deeply nested brackets
# with *interesting* spacing
def double(a: int) -> int:
return 2 * a


def double(a: int) -> int:
return 2 * a


def foo() -> (
intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds
):
return 2