elif => if (return statement before elif)

This commit is contained in:
grey-cat-1908 2022-03-27 00:10:52 +03:00 committed by GitHub
parent cabc848cb8
commit 95c6713586
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,18 +32,18 @@ def to_dict_without_none(model):
return dict(result)
elif isinstance(model, tuple) and hasattr(model, "_fields"):
if isinstance(model, tuple) and hasattr(model, "_fields"):
return type(model)(*[to_dict_without_none(v) for v in model])
elif isinstance(model, (list, tuple)):
if isinstance(model, (list, tuple)):
return type(model)(to_dict_without_none(v) for v in model)
elif isinstance(model, dict):
if isinstance(model, dict):
return type(model)(
(to_dict_without_none(k), to_dict_without_none(v)) for k, v in model.items()
)
else:
return copy.deepcopy(model)
return copy.deepcopy(model)
class APIModelBase: