Antoine Pitrou <pit...@free.fr> added the comment:

> Yes, I think we have a consensus on this point. Note, however that
> since unbound methods have been removed in 3.x, it is not trivial to
> find a fully qualified name of a method anymore.

I suppose only bound methods should be pickleable:

>>> class C:
...     def m(self): pass
... 
>>> c = C()
>>> c.m
<bound method C.m of <__main__.C object at 0x7fa81299b150>>
>>> c.m.__self__.__module__
'__main__'

And perhaps class methods too:

>>> class C:
...     @classmethod
...     def cm(self): pass
... 
>>> C.cm
<bound method type.cm of <class '__main__.C'>>
>>> C.cm.__self__
<class '__main__.C'>
>>> C.cm.__self__.__module__
'__main__'


> Also we need to
> decide where to stop: should methods of nested classes be pickleable?

As we want, but they needn't be.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9276>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to