Ethan Furman added the comment:

The only thing I hate more than being wrong is being wrong because Python isn't 
acting the way I think it should.  :/

So, __qualname__ is not set properly when using the function API (although it 
has nothing to do with manually setting __module__ (I removed it, tested, no 
difference)).

And, if a subclass defines __reduce__, but an ancestor class defines 
__reduce_ex__, the ancestor class wins -- this seems to completely defeat the 
purpose of subclassing.

I'll add a 'qualname' parameter (mirroring the 'module' parameter) to the 
function API, and I'll use __reduce_ex__.

A little experimenting shows that if the base class implements any of 
__reduce__, __reduce_ex__, __getnewargs__, or __getnewargs_ex__ that pickling 
will work, so modified that portion of Enum as well.

----------
nosy: +eli.bendersky
resolution: fixed -> 
Added file: http://bugs.python.org/file33993/issue20534.stoneleaf.03.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20534>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to