mirror of
https://github.com/ihabunek/toot
synced 2025-01-11 09:03:57 +01:00
Ignore warning not to compare types
No other way around it here.
This commit is contained in:
parent
b2c2f7466e
commit
8ad2b279ed
@ -410,7 +410,7 @@ def _prune_optional(field_type):
|
|||||||
"""For `Optional[<type>]` returns the encapsulated `<type>`."""
|
"""For `Optional[<type>]` returns the encapsulated `<type>`."""
|
||||||
if get_origin(field_type) == Union:
|
if get_origin(field_type) == Union:
|
||||||
args = get_args(field_type)
|
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 args[0]
|
||||||
|
|
||||||
return field_type
|
return field_type
|
||||||
|
Loading…
Reference in New Issue
Block a user