[pypy-dev] Functions `.__module__` attribute

cool-RR cool-rr at cool-rr.com
Tue May 10 20:47:18 CEST 2011


On Tue, May 10, 2011 at 2:41 PM, Antonio Cuni <anto.cuni at gmail.com> wrote:

> On 10/05/11 20:39, cool-RR wrote:
> > Ah, then my problem is easily solved by accessing
> `my_function.__module__`
> > before I change `__name__` back to its original value. I tested and it
> works.
>
> by the way, what do you need it for?
>

For this test:

https://github.com/cool-RR/GarlicSim/blob/master/garlicsim/test_garlicsim/test_general_misc/test_address_tools/test_describe.py#L270

<https://github.com/cool-RR/GarlicSim/blob/master/garlicsim/test_garlicsim/test_general_misc/test_address_tools/test_describe.py#L270>


>
> I think that, whatever you are doing, the best way is to explicitly assign
> func.__module__ to the value you want.
>

Maybe, if this issue will ever become relevant again I'll consider it.


Thanks, Ram.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20110510/84f5bbc8/attachment.html>


More information about the pypy-dev mailing list