Skip to content

Commit

Permalink
add deprecated=False parameter to more argparse classes for 3.13 (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
benchatt committed May 23, 2024
1 parent cf4678c commit 90f8cfc
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 10 deletions.
3 changes: 0 additions & 3 deletions stdlib/@tests/stubtest_allowlists/py313.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ _thread.start_new_thread
_tkinter.TkappType.gettrace
_tkinter.TkappType.settrace
_tkinter.create
argparse._AppendConstAction.__init__
argparse._CountAction.__init__
argparse._HelpAction.__init__
argparse._StoreConstAction.__init__
argparse._StoreFalseAction.__init__
argparse._StoreTrueAction.__init__
Expand Down
51 changes: 44 additions & 7 deletions stdlib/argparse.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,19 @@ class _ExtendAction(_AppendAction): ...

# undocumented
class _AppendConstAction(Action):
if sys.version_info >= (3, 11):
if sys.version_info >= (3, 13):
def __init__(
self,
option_strings: Sequence[str],
dest: str,
const: Any | None = None,
default: Any = None,
required: bool = False,
help: str | None = None,
metavar: str | tuple[str, ...] | None = None,
deprecated: bool = False,
) -> None: ...
elif sys.version_info >= (3, 11):
def __init__(
self,
option_strings: Sequence[str],
Expand All @@ -543,15 +555,40 @@ class _AppendConstAction(Action):

# undocumented
class _CountAction(Action):
def __init__(
self, option_strings: Sequence[str], dest: str, default: Any = None, required: bool = False, help: str | None = None
) -> None: ...
if sys.version_info >= (3, 13):
def __init__(
self,
option_strings: Sequence[str],
dest: str,
default: Any = None,
required: bool = False,
help: str | None = None,
deprecated: bool = False,
) -> None: ...
else:
def __init__(
self, option_strings: Sequence[str], dest: str, default: Any = None, required: bool = False, help: str | None = None
) -> None: ...

# undocumented
class _HelpAction(Action):
def __init__(
self, option_strings: Sequence[str], dest: str = "==SUPPRESS==", default: str = "==SUPPRESS==", help: str | None = None
) -> None: ...
if sys.version_info >= (3, 13):
def __init__(
self,
option_strings: Sequence[str],
dest: str = "==SUPPRESS==",
default: str = "==SUPPRESS==",
help: str | None = None,
deprecated: bool = False,
) -> None: ...
else:
def __init__(
self,
option_strings: Sequence[str],
dest: str = "==SUPPRESS==",
default: str = "==SUPPRESS==",
help: str | None = None,
) -> None: ...

# undocumented
class _VersionAction(Action):
Expand Down

0 comments on commit 90f8cfc

Please sign in to comment.