@@ -194,7 +194,7 @@ def validate(self, expected_input, all_request_inputs):
194
194
user_inputs = [user_input ]
195
195
# If typing.List in union and user supplied valid list, convert remaining check only for list
196
196
for exp_type in expected_input_types :
197
- if True in [ str (exp_type ).startswith (list_hint ) for list_hint in list_type_hints ] :
197
+ if any ( str (exp_type ).startswith (list_hint ) for list_hint in list_type_hints ) :
198
198
if type (user_input ) is list :
199
199
# Only convert if validation passes
200
200
if hasattr (exp_type , "__args__" ):
@@ -204,7 +204,7 @@ def validate(self, expected_input, all_request_inputs):
204
204
expected_input_type_str = str (exp_type )
205
205
user_inputs = user_input
206
206
# If list, expand inner typing items. Otherwise, convert to list to match anyway.
207
- elif True in [ expected_input_type_str .startswith (list_hint ) for list_hint in list_type_hints ] :
207
+ elif any ( expected_input_type_str .startswith (list_hint ) for list_hint in list_type_hints ) :
208
208
expected_input_types = expected_input_type .__args__
209
209
if type (user_input ) is list :
210
210
user_inputs = user_input
@@ -229,7 +229,7 @@ def validate(self, expected_input, all_request_inputs):
229
229
)
230
230
231
231
# Validate that if lists are required, lists are given
232
- if True in [ expected_input_type_str .startswith (list_hint ) for list_hint in list_type_hints ] :
232
+ if any ( expected_input_type_str .startswith (list_hint ) for list_hint in list_type_hints ) :
233
233
if type (user_input ) is not list :
234
234
validation_success = False
235
235
@@ -257,6 +257,6 @@ def validate(self, expected_input, all_request_inputs):
257
257
raise ValidationError (str (e ), expected_name , expected_input_type )
258
258
259
259
# Return input back to parent function
260
- if True in [ expected_input_type_str .startswith (list_hint ) for list_hint in list_type_hints ] :
260
+ if any ( expected_input_type_str .startswith (list_hint ) for list_hint in list_type_hints ) :
261
261
return user_inputs
262
262
return user_inputs [0 ]
0 commit comments