[Python-porting] Pickling unbound methods on Python 3

cool-RR cool-rr at cool-rr.com
Mon May 31 22:12:55 CEST 2010


On Mon, May 31, 2010 at 10:07 PM, "Martin v. Löwis" <martin at v.loewis.de>wrote:

>    I suppose the easiest way to add the information about the defining
>>    class is to have the class constructor add a function attribute
>>    to the (unbound) method functions. This should be the name of
>>    the defining class to avoid circular references.
>>
>> As a workaround that'll work, yeah. But we were discussing whether we
>> can make a real solution. (Unless you were proposing that Python itself
>> will do this and not just my program; In that case I'm totally with you,
>> but it seems that the Python community isn't.)
>>
>
> What makes you think so? I (personally) have objected to your hackish way
> of scanning the all classes in the module. Adding a function attribute is
> fine with me.
>

Great! I prefer adding an attribute to the unbound methods as well. Would
you like to raise this on python-dev or would you like me to? (I haven't
been active there and I don't know which issues are in consensus and which
aren't.) In any case `cc` me if you talk about it.


> I only wonder if it would be useful to generalize this beyond functions.
>

Sounds good.


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


More information about the Python-porting mailing list