Message349822
I am not sure that it is good idea to accept a type and an instance, but if it is a goal, is_dataclass() should be defined as:
def is_dataclass(obj):
cls = obj if isinstance(obj, type) else type(obj)
return hasattr(cls, _FIELDS)
_is_dataclass_instance() should be changed too:
def _is_dataclass_instance(obj):
return hasattr(type(obj), _FIELDS) |
|
Date |
User |
Action |
Args |
2019-08-15 20:04:32 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, eric.smith, Johan Hidding |
2019-08-15 20:04:31 | serhiy.storchaka | set | messageid: <1565899471.97.0.464982769005.issue37868@roundup.psfhosted.org> |
2019-08-15 20:04:31 | serhiy.storchaka | link | issue37868 messages |
2019-08-15 20:04:31 | serhiy.storchaka | create | |
|