[Python-Dev] PyPy, Jython, & IronPython: Enum convenience function and pickleablity

Antoine Pitrou solipsis at pitrou.net
Thu May 2 22:57:16 CEST 2013


On Thu, 2 May 2013 13:48:24 -0700
Eli Bendersky <eliben at gmail.com> wrote:
> On Thu, May 2, 2013 at 1:39 PM, Barry Warsaw <barry at python.org> wrote:
> 
> > On May 02, 2013, at 10:18 PM, Georg Brandl wrote:
> >
> > >5) accept that convenience-created enums have restrictions such as no
> > >picklability and point them out in the docs?
> >
> > That would work fine for me, but ultimately I'm with Guido.  I just don't
> > want
> > to have to pass the module name in.
> >
> 
> The problem with (5) is this: you use some library that exports an
> enumeration, and you want to use pickling. Now you depend on the way the
> library implemented - if it used the convenience API, you can't pickle. If
> it used the class API, you can.

A good reason to ditch the function-based syntax.

Regards

Antoine.




More information about the Python-Dev mailing list