[issue22955] Pickling of methodcaller, attrgetter, and itemgetter

Serhiy Storchaka report at bugs.python.org
Sat Nov 29 23:10:38 CET 2014


Serhiy Storchaka added the comment:

operator.methodcaller is similar to functools.partial which is pickleable and can be used as a sample.

In C implementation some code can be shared between __repr__ and __reduce__ methods.

As for tests, different protocols should be tested. Also should be tested compatibility between C and Python implementations, instances pickled with one implementation should be unpickleable with other implementation. Move pickle tests into new test class.

If add __repr__ methods, they need tests. The restriction of method name type should be tested too.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22955>
_______________________________________


More information about the Python-bugs-list mailing list