Skip to content

Commit 42eaca5

Browse files
argparse: add |str to SUPPRESS type
1 parent 25ad2b2 commit 42eaca5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

stdlib/argparse.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ OPTIONAL: Literal["?"]
6868
PARSER: Literal["A..."]
6969
REMAINDER: Literal["..."]
7070
_SUPPRESS_T = NewType("_SUPPRESS_T", str)
71-
SUPPRESS: _SUPPRESS_T # not using Literal because argparse sometimes compares SUPPRESS with is
71+
SUPPRESS: _SUPPRESS_T | str # not using Literal because argparse sometimes compares SUPPRESS with is
72+
# the | str is there so that foo = argparse.SUPPRESS; foo = "test" checks out in mypy
7273
ZERO_OR_MORE: Literal["*"]
7374
_UNRECOGNIZED_ARGS_ATTR: str # undocumented
7475

0 commit comments

Comments
 (0)