Message210629
Serhiy commented:
-----------------
> Actually they don't pickle due to wrong __module__. After adding
>
> NEI.__module__ = NamedInt.__module__ = __name__
>
> PicklingError no longer raised for enum class.
If you were to look at the `_make_class_unpicklable` function you would see it works by setting __module__ to <unknown>. So, in fact, it does not pickle precisely because it has the wrong module, and your change undoes what Enum was tryng to do: if an instance cannot be pickled, don't let the class be pickled either. |
|
Date |
User |
Action |
Args |
2014-02-08 13:08:43 | ethan.furman | set | recipients:
+ ethan.furman, barry, pitrou, alexandre.vassalotti, eli.bendersky, python-dev, serhiy.storchaka |
2014-02-08 13:08:43 | ethan.furman | set | messageid: <1391864923.57.0.653338667822.issue20534@psf.upfronthosting.co.za> |
2014-02-08 13:08:43 | ethan.furman | link | issue20534 messages |
2014-02-08 13:08:43 | ethan.furman | create | |
|