@@ -800,9 +800,11 @@ def register_command_set(self, cmdset: CommandSet) -> None:
800800 list [tuple [str , Callable [..., Any ]]],
801801 inspect .getmembers (
802802 cmdset ,
803- predicate = lambda meth : isinstance (meth , Callable ) # type: ignore[arg-type]
804- and hasattr (meth , '__name__' )
805- and meth .__name__ .startswith (COMMAND_FUNC_PREFIX ),
803+ predicate = lambda meth : ( # type: ignore[arg-type]
804+ isinstance (meth , Callable ) # type: ignore[arg-type]
805+ and hasattr (meth , '__name__' )
806+ and meth .__name__ .startswith (COMMAND_FUNC_PREFIX )
807+ ),
806808 ),
807809 )
808810
@@ -955,9 +957,11 @@ def unregister_command_set(self, cmdset: CommandSet) -> None:
955957
956958 methods : list [tuple [str , Callable [..., Any ]]] = inspect .getmembers (
957959 cmdset ,
958- predicate = lambda meth : isinstance (meth , Callable ) # type: ignore[arg-type]
959- and hasattr (meth , '__name__' )
960- and meth .__name__ .startswith (COMMAND_FUNC_PREFIX ),
960+ predicate = lambda meth : ( # type: ignore[arg-type]
961+ isinstance (meth , Callable ) # type: ignore[arg-type]
962+ and hasattr (meth , '__name__' )
963+ and meth .__name__ .startswith (COMMAND_FUNC_PREFIX )
964+ ),
961965 )
962966
963967 for cmd_func_name , command_method in methods :
@@ -1001,9 +1005,11 @@ def check_parser_uninstallable(parser: argparse.ArgumentParser) -> None:
10011005
10021006 methods : list [tuple [str , Callable [..., Any ]]] = inspect .getmembers (
10031007 cmdset ,
1004- predicate = lambda meth : isinstance (meth , Callable ) # type: ignore[arg-type]
1005- and hasattr (meth , '__name__' )
1006- and meth .__name__ .startswith (COMMAND_FUNC_PREFIX ),
1008+ predicate = lambda meth : ( # type: ignore[arg-type]
1009+ isinstance (meth , Callable ) # type: ignore[arg-type]
1010+ and hasattr (meth , '__name__' )
1011+ and meth .__name__ .startswith (COMMAND_FUNC_PREFIX )
1012+ ),
10071013 )
10081014
10091015 for cmd_func_name , command_method in methods :
@@ -1025,10 +1031,12 @@ def _register_subcommands(self, cmdset: Union[CommandSet, 'Cmd']) -> None:
10251031 # find methods that have the required attributes necessary to be recognized as a sub-command
10261032 methods = inspect .getmembers (
10271033 cmdset ,
1028- predicate = lambda meth : isinstance (meth , Callable ) # type: ignore[arg-type]
1029- and hasattr (meth , constants .SUBCMD_ATTR_NAME )
1030- and hasattr (meth , constants .SUBCMD_ATTR_COMMAND )
1031- and hasattr (meth , constants .CMD_ATTR_ARGPARSER ),
1034+ predicate = lambda meth : (
1035+ isinstance (meth , Callable ) # type: ignore[arg-type]
1036+ and hasattr (meth , constants .SUBCMD_ATTR_NAME )
1037+ and hasattr (meth , constants .SUBCMD_ATTR_COMMAND )
1038+ and hasattr (meth , constants .CMD_ATTR_ARGPARSER )
1039+ ),
10321040 )
10331041
10341042 # iterate through all matching methods
@@ -1114,10 +1122,12 @@ def _unregister_subcommands(self, cmdset: Union[CommandSet, 'Cmd']) -> None:
11141122 # find methods that have the required attributes necessary to be recognized as a sub-command
11151123 methods = inspect .getmembers (
11161124 cmdset ,
1117- predicate = lambda meth : isinstance (meth , Callable ) # type: ignore[arg-type]
1118- and hasattr (meth , constants .SUBCMD_ATTR_NAME )
1119- and hasattr (meth , constants .SUBCMD_ATTR_COMMAND )
1120- and hasattr (meth , constants .CMD_ATTR_ARGPARSER ),
1125+ predicate = lambda meth : (
1126+ isinstance (meth , Callable ) # type: ignore[arg-type]
1127+ and hasattr (meth , constants .SUBCMD_ATTR_NAME )
1128+ and hasattr (meth , constants .SUBCMD_ATTR_COMMAND )
1129+ and hasattr (meth , constants .CMD_ATTR_ARGPARSER )
1130+ ),
11211131 )
11221132
11231133 # iterate through all matching methods
0 commit comments