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 enaumov
Recipients enaumov
Date 2021-02-06.05:46:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
A simple example is documented here: but it doesn't look like it was actually filed as a bug against CPython... Copy paste of the minimal reproducing example:

from dataclasses import asdict, dataclass

@dataclass(eq=True, frozen=True)
class A:
  a: str

@dataclass(eq=True, frozen=True)
class B:
  b: dict[A, str]


The offending code are these lines in

    elif isinstance(obj, dict):
        return type(obj)((_asdict_inner(k, dict_factory),
                          _asdict_inner(v, dict_factory))

The _asdict_inner(k, dict_factory) [correctly] turns dataclasses into dicts... which are not hashable. I assume there is a good reason the _asdict_inner function is called on the key, but its failure in this case looks like a (rather annoying!) error.
Date User Action Args
2021-02-06 05:46:54enaumovsetrecipients: + enaumov
2021-02-06 05:46:54enaumovsetmessageid: <>
2021-02-06 05:46:54enaumovlinkissue43141 messages
2021-02-06 05:46:54enaumovcreate