Skip to content

Commit e43176e

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

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
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

tests/stubtest_allowlists/py3_common.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,6 @@ xml.parsers.expat.expat_CAPI
236236
# Allowlist entries that cannot or should not be fixed
237237
# ==========
238238
_pydecimal.* # See comments in file
239-
argparse.SUPPRESS # See comment in file
240239
ast.NodeVisitor.visit_\w+ # Methods are discovered dynamically, see #3796
241240
# Weird special builtins that are typed as functions, but aren't functions
242241
builtins.copyright

0 commit comments

Comments
 (0)