-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid magic-trailing-comma in single tuple type
- Loading branch information
Showing
6 changed files
with
78 additions
and
8 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,34 @@ | ||
import typing | ||
from typing import List, Tuple | ||
|
||
# We should not treat the trailing comma | ||
# in a single-element tuple type as a magic comma. | ||
a: tuple[int,] | ||
b: Tuple[int,] | ||
c: typing.Tuple[int,] | ||
|
||
# The magic comma still applies to non tuple types. | ||
d: list[int,] | ||
e: List[int,] | ||
f: typing.List[int,] | ||
|
||
# output | ||
import typing | ||
from typing import List, Tuple | ||
|
||
# We should not treat the trailing comma | ||
# in a single-element tuple type as a magic comma. | ||
a: tuple[int,] | ||
b: Tuple[int,] | ||
c: typing.Tuple[int,] | ||
|
||
# The magic comma still applies to non tuple types. | ||
d: list[ | ||
int, | ||
] | ||
e: List[ | ||
int, | ||
] | ||
f: typing.List[ | ||
int, | ||
] |
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