[issue45546] Unable to pickle enum with nested frozen dataclass?

Eric Cousineau report at bugs.python.org
Wed Oct 20 19:27:43 EDT 2021


Eric Cousineau <eric.cousineau at tri.global> added the comment:

Thinking on it some more, I the current `Enum` metaclass doesn't distinguish between nested class and normal field, so it wraps it, thus why `pickle` gets confused.

Perhaps it's possible to recognize this case - the class w/ `__qualname__` can be checked to see if it's nested.

If so, then options are (a) skip wrapping the field, (b) failing fast, or (c) "no fix"?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45546>
_______________________________________


More information about the Python-bugs-list mailing list