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 colin-b
Recipients colin-b
Date 2019-07-02.13:44:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1562075043.32.0.192151434344.issue37485@roundup.psfhosted.org>
In-reply-to
Content
Hi,

When using inheritance with dataclass, "standard" instance methods that are provided with a default behavior thanks to dataclass are not overridable using inheritance.

Please see the sample below (or the attached file):

import dataclasses


@dataclasses.dataclass
class A:
    def __eq__(self, other):
        return True


@dataclasses.dataclass
class B(A):
    pass


print(A() == 1) # Returns True as expected
print(B() == 1) # Returns False instead of True as expected via inheritance


Thanks again
History
Date User Action Args
2019-07-02 13:44:03colin-bsetrecipients: + colin-b
2019-07-02 13:44:03colin-bsetmessageid: <1562075043.32.0.192151434344.issue37485@roundup.psfhosted.org>
2019-07-02 13:44:03colin-blinkissue37485 messages
2019-07-02 13:44:03colin-bcreate