@@ -100,12 +100,24 @@ class _StoreSplitAction(argparse.Action):
100
100
separator, then stores the resulting list.
101
101
"""
102
102
103
- def __init__ (self , option_strings , dest , nargs = None , ** kwargs ):
103
+ def __init__ (
104
+ self ,
105
+ option_strings : list [str ],
106
+ dest : str ,
107
+ nargs = None ,
108
+ ** kwargs ,
109
+ ):
104
110
self .sep = kwargs .pop ("sep" , None )
105
111
self .format = kwargs .pop ("format" , None )
106
112
super ().__init__ (option_strings , dest , nargs = nargs , ** kwargs )
107
113
108
- def __call__ (self , parser , namespace , values , option_string ):
114
+ def __call__ (
115
+ self ,
116
+ parser : argparse .ArgumentParser ,
117
+ namespace : argparse .Namespace ,
118
+ values : str ,
119
+ option_string : str ,
120
+ ):
109
121
if not isinstance (values , str ):
110
122
raise TypeError ("store_split expects string values" )
111
123
split_values = values .split (self .sep )
@@ -125,12 +137,24 @@ class _ExtendMatchAction(argparse.Action):
125
137
pattern, then extends the destination list using the result(s).
126
138
"""
127
139
128
- def __init__ (self , option_strings , dest , nargs = None , ** kwargs ):
140
+ def __init__ (
141
+ self ,
142
+ option_strings : list [str ],
143
+ dest : str ,
144
+ nargs = None ,
145
+ ** kwargs ,
146
+ ):
129
147
self .pattern = kwargs .pop ("pattern" , None )
130
148
self .format = kwargs .pop ("format" , None )
131
149
super ().__init__ (option_strings , dest , nargs = nargs , ** kwargs )
132
150
133
- def __call__ (self , parser , namespace , value , option_string ):
151
+ def __call__ (
152
+ self ,
153
+ parser : argparse .ArgumentParser ,
154
+ namespace : argparse .Namespace ,
155
+ value : str ,
156
+ option_string : str ,
157
+ ):
134
158
if not isinstance (value , str ):
135
159
raise TypeError ("extend_match expects string value" )
136
160
matches = re .findall (self .pattern , value )
0 commit comments