I agree with Ethan, Elvis, and a few others. I think 'hash=True, frozen=False' should be disabled in 3.7. It's an attractive nuisance. Maybe not so attractive because its obscurity, but still with no clear reason to exist.
If many users of of dataclass find themselves defining '__hash__' with mutable dataclass, it's perfectly possible to allow the switch combination later. But taking it out after previously allowing it—even if every use in the wild is actually a bug in waiting—is harder. On Feb 2, 2018 2:10 PM, "Ethan Furman" <et...@stoneleaf.us> wrote: > On 02/02/2018 08:09 AM, Eric V. Smith wrote: > >> On 2/2/2018 10:56 AM, Elvis Pranskevichus wrote: >> > > My point is exactly that there is _no_ valid use case, so (hash=True, >>> frozen=False) should not be a thing! Why are you so insistent on adding >>> a dangerous option which you admit is nearly useless? >>> >> >> Because it's not the default, it will be documented as being an advanced >> use case, and it's useful in rare instances. >> > > Personally, I don't think advanced use-cases need to be supported by flags > as they can be supported by just writing the __dunder__ methods. > > -- > ~Ethan~ > _______________________________________________ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: https://mail.python.org/mailman/options/python-dev/mertz% > 40gnosis.cx >
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com