File tree 2 files changed +6
-1
lines changed 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,6 @@ When you're puzzled or when things are complicated
134
134
# type: (* str , ** str ) -> str
135
135
request = make_request(* args, ** kwargs)
136
136
return self .do_api_query(request)
137
-
138
137
139
138
# Use `ignore` to suppress type-checking on a given line, when your
140
139
# code confuses mypy or runs into an outright bug in mypy.
Original file line number Diff line number Diff line change @@ -122,6 +122,12 @@ When you're puzzled or when things are complicated
122
122
# dynamic to write a type for.
123
123
x = mystery_function() # type: Any
124
124
125
+ # This is how to deal with varargs.
126
+ # This makes each positional arg and each keyword arg a 'str'.
127
+ def call (self , * args : str , ** kwargs : str ) -> str :
128
+ request = make_request(* args, ** kwargs)
129
+ return self .do_api_query(request)
130
+
125
131
# Use `ignore` to suppress type-checking on a given line, when your
126
132
# code confuses mypy or runs into an outright bug in mypy.
127
133
# Good practice is to comment every `ignore` with a bug link
You can’t perform that action at this time.
0 commit comments