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 ethan.furman
Recipients alexandre.vassalotti, barry, eli.bendersky, ethan.furman, pitrou, python-dev, serhiy.storchaka
Date 2014-02-08.13:00:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1391864447.61.0.935879196518.issue20534@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-02-08 13:00:48ethan.furmansetrecipients: + ethan.furman, barry, pitrou, alexandre.vassalotti, eli.bendersky, python-dev, serhiy.storchaka
2014-02-08 13:00:47ethan.furmansetmessageid: <1391864447.61.0.935879196518.issue20534@psf.upfronthosting.co.za>
2014-02-08 13:00:47ethan.furmanlinkissue20534 messages
2014-02-08 13:00:47ethan.furmancreate