[issue20653] Pickle enums by name

Antoine Pitrou report at bugs.python.org
Fri Feb 21 11:37:47 CET 2014


Antoine Pitrou added the comment:

> If the mixed-in class defines __reduce_ex__, and the Enum class
> defines __reduce__, pickle will see that the Enum class has both, and
> will call the _ex__ method.

Ah, I understand your concern. You are using "preferred" in a different
sense. The pickle docs don't mention __reduce_ex__ as being preferred,
as in "you should use this one", on the contrary.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20653>
_______________________________________


More information about the Python-bugs-list mailing list