From 90f8cfca0bba57fc46616c62c47b0880250da3c4 Mon Sep 17 00:00:00 2001 From: benchatt Date: Thu, 23 May 2024 14:13:41 -0400 Subject: [PATCH] add `deprecated=False` parameter to more argparse classes for 3.13 (#12018) --- stdlib/@tests/stubtest_allowlists/py313.txt | 3 -- stdlib/argparse.pyi | 51 ++++++++++++++++++--- 2 files changed, 44 insertions(+), 10 deletions(-) diff --git a/stdlib/@tests/stubtest_allowlists/py313.txt b/stdlib/@tests/stubtest_allowlists/py313.txt index 6fc5ef5c2..0cc3de315 100644 --- a/stdlib/@tests/stubtest_allowlists/py313.txt +++ b/stdlib/@tests/stubtest_allowlists/py313.txt @@ -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__ diff --git a/stdlib/argparse.pyi b/stdlib/argparse.pyi index a0e59630d..81b56126a 100644 --- a/stdlib/argparse.pyi +++ b/stdlib/argparse.pyi @@ -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], @@ -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):