[Python-porting] Pickling unbound methods on Python 3

cool-RR cool-rr at cool-rr.com
Mon May 31 00:57:58 CEST 2010


On Sun, May 30, 2010 at 11:48 PM, "Martin v. Löwis" <martin at v.loewis.de>wrote:

> What if we'll try the expensive stuff after the old way (shallow module
>> search) fails and is about to raise an exception?
>>
>
> Feel free to submit a patch. However, if this needs to be fixed at all (and
> I'm not convinced it does), then I'd rather see a proper fix, i.e. one where
> you find the class from the function object directly, or which
> has an even more general way of identifying global objects.
>
> Regards,
> Martin
>

I agree, and that was what I wanted from the beginning. But several people
have told me that it's *impossible* to find the class that an unbound method
was defined on. So I came up with this workaround instead.

I'll consider making a patch. Thanks for your help Martin.

By the way, when this discussion continues / when I make the patch, should I
post on python-dev instead of here?

Ram.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-porting/attachments/20100531/11bb6ab9/attachment.html>


More information about the Python-porting mailing list