(original) (raw)
2013/5/2 Guido van Rossum <guido@python.org>
It works fine on PyPy as well.
On Thu, May 2, 2013 at 1:18 PM, fwierzbicki@gmail.comThis particular function is typically only called at module load time,
<fwierzbicki@gmail.com> wrote:
\> On Thu, May 2, 2013 at 12:07 PM, Ethan Furman <ethan@stoneleaf.us> wrote:
\>> In order for the Enum convenience function to be pickleable, we have this
\>> line of code in the metaclass:
\>>
\>> � � enum\_class.\_\_module\_\_ = sys.\_getframe(1).f\_globals\['\_\_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.
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