This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients Johan Hidding, eric.smith, serhiy.storchaka
Date 2019-08-15.20:04:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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:32serhiy.storchakasetrecipients: + serhiy.storchaka, eric.smith, Johan Hidding
2019-08-15 20:04:31serhiy.storchakasetmessageid: <>
2019-08-15 20:04:31serhiy.storchakalinkissue37868 messages
2019-08-15 20:04:31serhiy.storchakacreate