@@ -46,7 +46,7 @@ def _is_branch_key(parser, key: str) -> bool:
4646
4747
4848def _find_action_and_subcommand (
49- parser : Union [" ArgumentParser" , " ActionsContainer" ],
49+ parser : Union [ArgumentParser , ActionsContainer ],
5050 dest : str ,
5151 exclude : Optional [Union [Type [ArgparseAction ], Tuple [Type [ArgparseAction ], ...]]] = None ,
5252) -> Tuple [Optional [ArgparseAction ], Optional [str ]]:
@@ -83,15 +83,15 @@ def _find_action_and_subcommand(
8383
8484
8585def _find_action (
86- parser : Union [" ArgumentParser" , " ActionsContainer" ],
86+ parser : Union [ArgumentParser , ActionsContainer ],
8787 dest : str ,
8888 exclude : Optional [Union [Type [ArgparseAction ], Tuple [Type [ArgparseAction ], ...]]] = None ,
8989) -> Optional [ArgparseAction ]:
9090 return _find_action_and_subcommand (parser , dest , exclude = exclude )[0 ]
9191
9292
9393def _find_parent_action_and_subcommand (
94- parser : " ArgumentParser" ,
94+ parser : ArgumentParser ,
9595 key : str ,
9696 exclude : Optional [Union [Type [ArgparseAction ], Tuple [Type [ArgparseAction ], ...]]] = None ,
9797) -> Tuple [Optional [ArgparseAction ], Optional [str ]]:
@@ -106,7 +106,7 @@ def _find_parent_action_and_subcommand(
106106
107107
108108def _find_parent_action (
109- parser : " ArgumentParser" ,
109+ parser : ArgumentParser ,
110110 key : str ,
111111 exclude : Optional [Union [Type [ArgparseAction ], Tuple [Type [ArgparseAction ], ...]]] = None ,
112112) -> Optional [ArgparseAction ]:
@@ -516,7 +516,7 @@ class ActionParser:
516516
517517 def __init__ (
518518 self ,
519- parser : Optional [" ArgumentParser" ] = None ,
519+ parser : Optional [ArgumentParser ] = None ,
520520 ):
521521 """Initializer for ActionParser instance.
522522
@@ -616,7 +616,7 @@ def parent_parsers_context(key, parser):
616616class _ActionSubCommands (_SubParsersAction ):
617617 """Extension of argparse._SubParsersAction to modify subcommands functionality."""
618618
619- parent_parser : " ArgumentParser"
619+ parent_parser : ArgumentParser
620620 env_prefix : str
621621
622622 def add_parser (self , name , ** kwargs ):
@@ -692,11 +692,11 @@ def not_single_subcommand():
692692
693693 @staticmethod
694694 def get_subcommands (
695- parser : " ArgumentParser" ,
695+ parser : ArgumentParser ,
696696 cfg : Namespace ,
697697 prefix : str = "" ,
698698 fail_no_subcommand : bool = True ,
699- ) -> Tuple [Optional [List [str ]], Optional [List [" ArgumentParser" ]]]:
699+ ) -> Tuple [Optional [List [str ]], Optional [List [ArgumentParser ]]]:
700700 """Returns subcommand names and corresponding subparsers."""
701701 if parser ._subcommands_action is None :
702702 return None , None
@@ -748,11 +748,11 @@ def get_subcommands(
748748
749749 @staticmethod
750750 def get_subcommand (
751- parser : " ArgumentParser" ,
751+ parser : ArgumentParser ,
752752 cfg : Namespace ,
753753 prefix : str = "" ,
754754 fail_no_subcommand : bool = True ,
755- ) -> Tuple [Optional [str ], Optional [" ArgumentParser" ]]:
755+ ) -> Tuple [Optional [str ], Optional [ArgumentParser ]]:
756756 """Returns a single subcommand name and corresponding subparser."""
757757 subcommands , subparsers = _ActionSubCommands .get_subcommands (
758758 parser ,
@@ -764,7 +764,7 @@ def get_subcommand(
764764
765765 @staticmethod
766766 def handle_subcommands (
767- parser : " ArgumentParser" ,
767+ parser : ArgumentParser ,
768768 cfg : Namespace ,
769769 env : Optional [bool ],
770770 defaults : bool ,
0 commit comments