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 ncoghlan
Recipients eric.smith, gvanrossum, larry, levkivskyi, ncoghlan
Date 2018-01-27.02:58:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1517021914.24.0.467229070634.issue32513@psf.upfronthosting.co.za>
In-reply-to
Content
Eric's current proposal sounds sensible to me, but I'll note that if we deem it necessary, the code that implicitly sets `__hash__ = None` to override object.__hash__ when __eq__ is defined could also set some other marker to make it more explicit that that happened.

I think Eric's proposed heuristic will be sufficient, though - for subclasses that inherit both __hash__ and __eq__ from a base class the dataclass decorator won't pay any attention to either of them, and if a base class has set __hash__ to something, then the type creation machinery won't inject "__hash__ = None" into the class being defined.
History
Date User Action Args
2018-01-27 02:58:34ncoghlansetrecipients: + ncoghlan, gvanrossum, larry, eric.smith, levkivskyi
2018-01-27 02:58:34ncoghlansetmessageid: <1517021914.24.0.467229070634.issue32513@psf.upfronthosting.co.za>
2018-01-27 02:58:34ncoghlanlinkissue32513 messages
2018-01-27 02:58:33ncoghlancreate