code review 1/n -- change hasattr to getattr

This commit is contained in:
Aly Sivji 2018-08-04 08:29:55 -05:00
parent 025d160dfc
commit e1e81e315e
1 changed files with 2 additions and 2 deletions

View File

@ -123,10 +123,10 @@ def assertrepr_compare(config, op, left, right):
return isinstance(x, (set, frozenset))
def isdatacls(obj):
return hasattr(obj, "__dataclass_fields__")
return getattr(obj, "__dataclass_fields__", None) is not None
def isattrs(obj):
return hasattr(obj, "__attrs_attrs__")
return getattr(obj, "__attrs_attrs__", None) is not None
def isiterable(obj):
try: