@@ -161,7 +161,28 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
161161 _subparsers : _ArgumentGroup | None
162162
163163 # Note: the constructor arguments are also used in _SubParsersAction.add_parser.
164- if sys .version_info >= (3 , 14 ):
164+ if sys .version_info >= (3 , 15 ):
165+ def __init__ (
166+ self ,
167+ prog : str | None = None ,
168+ usage : str | None = None ,
169+ description : str | None = None ,
170+ epilog : str | None = None ,
171+ parents : Iterable [ArgumentParser ] = [],
172+ formatter_class : _FormatterClass = ...,
173+ prefix_chars : str = "-" ,
174+ fromfile_prefix_chars : str | None = None ,
175+ argument_default : Any = None ,
176+ conflict_handler : str = "error" ,
177+ add_help : bool = True ,
178+ allow_abbrev : bool = True ,
179+ exit_on_error : bool = True ,
180+ * ,
181+ suggest_on_error : bool = True ,
182+ color : bool = True ,
183+ ) -> None : ...
184+
185+ elif sys .version_info >= (3 , 14 ):
165186 def __init__ (
166187 self ,
167188 prog : str | None = None ,
@@ -236,8 +257,14 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
236257 ) -> _SubParsersAction [_ArgumentParserT ]: ...
237258 def print_usage (self , file : SupportsWrite [str ] | None = None ) -> None : ...
238259 def print_help (self , file : SupportsWrite [str ] | None = None ) -> None : ...
239- def format_usage (self ) -> str : ...
240- def format_help (self ) -> str : ...
260+ if sys .version_info >= (3 , 15 ):
261+ def format_usage (self , formatter : HelpFormatter | None = None ) -> str : ...
262+ def format_help (self , formatter : HelpFormatter | None = None ) -> str : ...
263+
264+ else :
265+ def format_usage (self ) -> str : ...
266+ def format_help (self ) -> str : ...
267+
241268 @overload
242269 def parse_known_args (self , args : Iterable [str ] | None = None , namespace : None = None ) -> tuple [Namespace , list [str ]]: ...
243270 @overload
@@ -284,7 +311,11 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
284311 def _get_values (self , action : Action , arg_strings : list [str ]) -> Any : ...
285312 def _get_value (self , action : Action , arg_string : str ) -> Any : ...
286313 def _check_value (self , action : Action , value : Any ) -> None : ...
287- def _get_formatter (self ) -> HelpFormatter : ...
314+ if sys .version_info >= (3 , 15 ):
315+ def _get_formatter (self , file : SupportsWrite [str ] | None = None ) -> HelpFormatter : ...
316+ else :
317+ def _get_formatter (self ) -> HelpFormatter : ...
318+
288319 def _print_message (self , message : str , file : SupportsWrite [str ] | None = None ) -> None : ...
289320
290321class HelpFormatter :
@@ -309,7 +340,12 @@ class HelpFormatter:
309340 def __init__ (self , formatter : HelpFormatter , parent : Self | None , heading : str | None = None ) -> None : ...
310341 def format_help (self ) -> str : ...
311342
312- if sys .version_info >= (3 , 14 ):
343+ if sys .version_info >= (3 , 15 ):
344+ def __init__ (
345+ self , prog : str , indent_increment : int = 2 , max_help_position : int = 24 , width : int | None = None
346+ ) -> None : ...
347+
348+ elif sys .version_info >= (3 , 14 ):
313349 def __init__ (
314350 self , prog : str , indent_increment : int = 2 , max_help_position : int = 24 , width : int | None = None , color : bool = True
315351 ) -> None : ...
0 commit comments