[Python-Dev] PyPy, Jython, & IronPython: Enum convenience function and pickleablity (original) (raw)
Amaury Forgeot d'Arc amauryfa at gmail.com
Thu May 2 23:54:43 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 ]
2013/5/2 Guido van Rossum <guido at python.org>
On Thu, May 2, 2013 at 1:18 PM, fwierzbicki at gmail.com <fwierzbicki at gmail.com> wrote: > On Thu, May 2, 2013 at 12:07 PM, Ethan Furman <ethan at stoneleaf.us> wrote: >> 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? > This should work for Jython, but I can't say I like it. I believe > IronPython has a sort of speedup mode that disallows the use of > getframe, and I'd like to add this to Jython someday.
This particular function is typically only called at module load time, so speeding it up isn't worth it.
It works fine on PyPy as well. It probably also kills any JIT optimization, but it's not an issue since classes are not usually created in tight loops.
-- Amaury Forgeot d'Arc -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20130502/43ce28aa/attachment.html>
- 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 ]