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

Eli Bendersky eliben at gmail.com
Thu May 2 23:11:53 CEST 2013


On Thu, May 2, 2013 at 2:05 PM, Ethan Furman <ethan at stoneleaf.us> wrote:

> On 05/02/2013 01:52 PM, Eli Bendersky wrote:
>
>>
>> Back to my question from before, though - do we have a real technical
>> limitation of having something like
>> inspect.what_module_am_i_now_**in() that's supposed to work for all
>> Python code?
>>
>
> By which you really mean inspect.what_module_was_I_called_from() ?
>
>
Yes, I guess this is what I meant by "now_in" part. Let's be precise:

Animal = Enum('Animal', '...........')

The call to Enum is the interesting here. In happens in some library and
Animal members can then be passed around. But we really want the module
where Enum() was invoked to create Animal in the first place.

Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20130502/499a1efd/attachment.html>


More information about the Python-Dev mailing list