Message310836
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. |
|
Date |
User |
Action |
Args |
2018-01-27 02:58:34 | ncoghlan | set | recipients:
+ ncoghlan, gvanrossum, larry, eric.smith, levkivskyi |
2018-01-27 02:58:34 | ncoghlan | set | messageid: <1517021914.24.0.467229070634.issue32513@psf.upfronthosting.co.za> |
2018-01-27 02:58:34 | ncoghlan | link | issue32513 messages |
2018-01-27 02:58:33 | ncoghlan | create | |
|