GitHub PR #29867 changed dataclasses’ check for mutable field default hard-coded
dict to anything with
__hash__ = None. This allowed non-mutable subclasses of these built-ins, but disallows any custom types that didn’t set
This is easy to support, but I didn’t know it was a problem until after I tested my library with Python 3.11 (at which point the docs said how to fix). I propose to bring more attention to this change by including it in the what’s new page. Right now, it’s buried in the change log.
for my pseudo-immutable object with
__slots__ = (), define
def __hash__(slf): return 42↩︎