Update _erg_in_operator.py

This commit is contained in:
Shunsuke Shibayama 2023-02-12 01:48:23 +09:00
parent af0fff8226
commit e94acfcc0b

View file

@ -5,7 +5,7 @@ def in_operator(elem, y):
if type(y) == type:
if isinstance(elem, y):
return True
elif is_ok(y.try_new(elem)):
elif hasattr(y, "try_new") and is_ok(y.try_new(elem)):
return True
# TODO: trait check
return False