<div dir="ltr"><div class="gmail_extra">2013/5/2 Guido van Rossum <span dir="ltr"><<a href="mailto:guido@python.org" target="_blank">guido@python.org</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Thu, May 2, 2013 at 1:18 PM, <a href="mailto:fwierzbicki@gmail.com">fwierzbicki@gmail.com</a><br>
<<a href="mailto:fwierzbicki@gmail.com">fwierzbicki@gmail.com</a>> wrote:<br>
> On Thu, May 2, 2013 at 12:07 PM, <span class="il">Ethan</span> Furman <<a href="mailto:ethan@stoneleaf.us"><span class="il">ethan</span>@stoneleaf.us</a>> wrote:<br>
>> In order for the Enum convenience function to be pickleable, we have this<br>
>> line of code in the metaclass:<br>
>><br>
>>     enum_class.__module__ = sys._getframe(1).f_globals['__name__']<br>
>><br>
>> This works fine for Cpython, but what about the others?<br>
> This should work for Jython, but I can't say I like it. I believe<br>
> IronPython has a sort of speedup mode that disallows the use of<br>
> _getframe, and I'd like to add this to Jython someday.<br>
<br>
</div>This particular function is typically only called at module load time,<br>
so speeding it up isn't worth it.</blockquote></div><br>It works fine on PyPy as well.</div><div class="gmail_extra">It probably also kills any JIT optimization,</div><div class="gmail_extra">but it's not an issue since classes are not usually created in tight loops.</div>
<div class="gmail_extra"><div><br></div>-- <br>Amaury Forgeot d'Arc
</div></div>