[Python-porting] Pickling unbound methods on Python 3

"Martin v. Löwis" martin at v.loewis.de
Mon May 31 23:26:01 CEST 2010


Am 31.05.2010 22:25, schrieb cool-RR:
> On Mon, May 31, 2010 at 10:19 PM, "Martin v. Löwis" <martin at v.loewis.de
> <mailto:martin at v.loewis.de>> wrote:
>
>         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'm very skeptical that "raising" it will have any effect. Submit a
>     patch instead.
>
>
> I don't understand Martin. Unbound methods had an `.im_class` attribute
> in Python 2.x, which is what we're talking about, and for Python 3.x
> that attribute was purposefully removed. I am assuming it was a
> deliberate decision by the python-dev community and that they had good
> reasons for it. Am I not supposed to ask them about this before I put it
> back?

Sure, you can ask. However, instead of asking, please study the code: 
the subversion log is available to the general public. Find out (for 
yourself) what specific revision made the change, and you can save other 
contributors the time of doing the research for you.

You are mistaken that the the attribute was removed. It was not removed. 
Instead, the object returned from the attribute lookup was changed, and 
the "new" type just happened to have no im_class attribute.
It didn't have that attribute in 2.x, either.

Regards,
Martin


More information about the Python-porting mailing list