Ignore warning not to compare types

No other way around it here.
This commit is contained in:
Ivan Habunek 2023-06-26 17:02:58 +02:00
parent b2c2f7466e
commit 8ad2b279ed
No known key found for this signature in database
GPG Key ID: CDBD63C43A30BB95
1 changed files with 1 additions and 1 deletions

View File

@ -410,7 +410,7 @@ def _prune_optional(field_type):
"""For `Optional[<type>]` returns the encapsulated `<type>`."""
if get_origin(field_type) == Union:
args = get_args(field_type)
if len(args) == 2 and args[1] == type(None):
if len(args) == 2 and args[1] == type(None): # noqa
return args[0]
return field_type