[Python-Dev] PyPy, Jython, & IronPython: Enum convenience function and pickleablity (original) (raw)
Georg Brandl g.brandl at gmx.net
Thu May 2 22🔞55 CEST 2013
- Previous message: [Python-Dev] PyPy, Jython, & IronPython: Enum convenience function and pickleablity
- Next message: [Python-Dev] PyPy, Jython, & IronPython: Enum convenience function and pickleablity
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Am 02.05.2013 22:10, schrieb Antoine Pitrou:
On Thu, 2 May 2013 15:48:14 -0400 Benjamin Peterson <benjamin at python.org> wrote:
2013/5/2 Ethan Furman <ethan at stoneleaf.us>: > In order for the Enum convenience function to be pickleable, we have this > line of code in the metaclass: > > enumclass.module = sys.getframe(1).fglobals['name'] > > This works fine for Cpython, but what about the others?
Regardless of that, perhaps we should come up with better ways to do this. Two things that were suggested in private: 1) ask users to pass the module name to the convenience function explicitly (i.e. pass "seasonmodule.Season" instead of "Season" as the class "name"). Guido doesn't like it :-) 2) dicth the "convenience function" and replace it with a regular class-based syntax. Ethan doesn't like it :-)
- accept that convenience-created enums have restrictions such as no picklability and point them out in the docs?
Georg
- Previous message: [Python-Dev] PyPy, Jython, & IronPython: Enum convenience function and pickleablity
- Next message: [Python-Dev] PyPy, Jython, & IronPython: Enum convenience function and pickleablity
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]