On Thursday, February 1, 2018 8:37:41 PM EST Eric V. Smith wrote: > > hash=None and compare=True leads to the same result, which, I > > think is even worse. > > Have you actually tried that? I meant this: @dataclasses.dataclass(hash=True) class A: foo: int = dataclasses.field(compare=True) > I don't recommend ever specifying the decorator hash= parameter > unless you have an unusual use case, in which case it's on you to > get it right. In my experience this type of breakage is so subtle that people will happily write code lots of code like this without noticing. My main objection here is that the dataclass does not go far enough to prevent obviously wrong behaviour. Or it goes too far with the whole hash/ frozen distinction. Elvis
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4