-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into async_brackets
- Loading branch information
Showing
6 changed files
with
262 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,222 @@ | ||
# Control | ||
def double(a: int) -> int: | ||
return 2*a | ||
|
||
# Remove the brackets | ||
def double(a: int) -> (int): | ||
return 2*a | ||
|
||
# Some newline variations | ||
def double(a: int) -> ( | ||
int): | ||
return 2*a | ||
|
||
def double(a: int) -> (int | ||
): | ||
return 2*a | ||
|
||
def double(a: int) -> ( | ||
int | ||
): | ||
return 2*a | ||
|
||
# Don't lose the comments | ||
def double(a: int) -> ( # Hello | ||
int | ||
): | ||
return 2*a | ||
|
||
def double(a: int) -> ( | ||
int # Hello | ||
): | ||
return 2*a | ||
|
||
# Really long annotations | ||
def foo() -> ( | ||
intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds | ||
): | ||
return 2 | ||
|
||
def foo() -> intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds: | ||
return 2 | ||
|
||
def foo() -> intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds | intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds: | ||
return 2 | ||
|
||
def foo(a: int, b: int, c: int,) -> intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds: | ||
return 2 | ||
|
||
def foo(a: int, b: int, c: int,) -> intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds | intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds: | ||
return 2 | ||
|
||
# Split args but no need to split return | ||
def foo(a: int, b: int, 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 | ||
|
||
# Return type with commas | ||
def foo() -> ( | ||
tuple[int, int, int] | ||
): | ||
return 2 | ||
|
||
def foo() -> tuple[loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong, loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong, loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong]: | ||
return 2 | ||
|
||
# Magic trailing comma example | ||
def foo() -> tuple[int, int, int,]: | ||
return 2 | ||
|
||
# Long string example | ||
def frobnicate() -> "ThisIsTrulyUnreasonablyExtremelyLongClassName | list[ThisIsTrulyUnreasonablyExtremelyLongClassName]": | ||
pass | ||
|
||
# output | ||
# Control | ||
def double(a: int) -> int: | ||
return 2 * a | ||
|
||
|
||
# Remove the brackets | ||
def double(a: int) -> int: | ||
return 2 * a | ||
|
||
|
||
# Some newline variations | ||
def double(a: int) -> int: | ||
return 2 * a | ||
|
||
|
||
def double(a: int) -> int: | ||
return 2 * a | ||
|
||
|
||
def double(a: int) -> int: | ||
return 2 * a | ||
|
||
|
||
# Don't lose the comments | ||
def double(a: int) -> int: # Hello | ||
return 2 * a | ||
|
||
|
||
def double(a: int) -> int: # Hello | ||
return 2 * a | ||
|
||
|
||
# Really long annotations | ||
def foo() -> ( | ||
intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds | ||
): | ||
return 2 | ||
|
||
|
||
def foo() -> ( | ||
intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds | ||
): | ||
return 2 | ||
|
||
|
||
def foo() -> ( | ||
intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds | ||
| intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds | ||
): | ||
return 2 | ||
|
||
|
||
def foo( | ||
a: int, | ||
b: int, | ||
c: int, | ||
) -> intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds: | ||
return 2 | ||
|
||
|
||
def foo( | ||
a: int, | ||
b: int, | ||
c: int, | ||
) -> ( | ||
intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds | ||
| intsdfsafafafdfdsasdfsfsdfasdfafdsafdfdsfasdskdsdsfdsafdsafsdfdasfffsfdsfdsafafhdskfhdsfjdslkfdlfsdkjhsdfjkdshfkljds | ||
): | ||
return 2 | ||
|
||
|
||
# Split args but no need to split return | ||
def foo( | ||
a: int, | ||
b: int, | ||
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 | ||
|
||
|
||
# Return type with commas | ||
def foo() -> tuple[int, int, int]: | ||
return 2 | ||
|
||
|
||
def foo() -> ( | ||
tuple[ | ||
loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong, | ||
loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong, | ||
loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong, | ||
] | ||
): | ||
return 2 | ||
|
||
|
||
# Magic trailing comma example | ||
def foo() -> ( | ||
tuple[ | ||
int, | ||
int, | ||
int, | ||
] | ||
): | ||
return 2 | ||
|
||
|
||
# Long string example | ||
def frobnicate() -> ( | ||
"ThisIsTrulyUnreasonablyExtremelyLongClassName |" | ||
" list[ThisIsTrulyUnreasonablyExtremelyLongClassName]" | ||
): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters