Message112486
| Author |
pitrou |
| Recipients |
alexandre.vassalotti, belopolsky, eric.araujo, exarkun, lemburg, pitrou |
| Date |
2010年08月02日.15:08:18 |
| SpamBayes Score |
0.013991245 |
| Marked as misclassified |
No |
| Message-id |
<1280761700.47.0.104242825078.issue9276@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> 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. |
|