Skip to content

Commit c653be7

Browse files
authored
Use TypeAlias for argparse type aliases (#7664)
1 parent 85594df commit c653be7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stdlib/argparse.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys
22
from collections.abc import Callable, Generator, Iterable, Sequence
33
from typing import IO, Any, Generic, NewType, NoReturn, Pattern, Protocol, TypeVar, overload
4-
from typing_extensions import Literal
4+
from typing_extensions import Literal, TypeAlias
55

66
if sys.version_info >= (3, 9):
77
__all__ = [
@@ -53,11 +53,11 @@ _N = TypeVar("_N")
5353
# "store_false", "append", "append_const", "count", "help", "version",
5454
# "extend"], but using this would make it hard to annotate callers
5555
# that don't use a literal argument
56-
_ActionStr = str
56+
_ActionStr: TypeAlias = str
5757
# more precisely, Literal["?", "*", "+", "...", "A...",
5858
# "==SUPPRESS=="], but using this would make it hard to annotate
5959
# callers that don't use a literal argument
60-
_NArgsStr = str
60+
_NArgsStr: TypeAlias = str
6161

6262
ONE_OR_MORE: Literal["+"]
6363
OPTIONAL: Literal["?"]

0 commit comments

Comments
 (0)