Guido van Rossum wrote:
Here's an example of the difference:
class C: def f(s): pass f.__repr__ = lambda: "42" print C().f.__repr__()
This prints "42". If you comment out the PyDescr_IsData() call, it will print "<bound method C.f of <__main__.C instance at 0x...>>".
I'm not entirely clear what goes wrong in your case.
Well, in my case, I try to pickle a bound method, so I expect that C().f.__reduce__ gives me a reasonable object: A method of an instance of C that is able to do an __reduce__, that is, I need the bound f and try to get its __reduce__ in a bound way.
If that's not the way to do it, which is it?
thanks - chris