[issue22955] Pickling of methodcaller, attrgetter, and itemgetter

Josh Rosenberg report at bugs.python.org
Sat Nov 29 03:57:36 CET 2014


Josh Rosenberg added the comment:

I've made a patch that I believe should cover all three cases, including tests.

In addition to the pickling behavior, I've made two other changes:

1. methodcaller verifies during construction that the name is a string (PyUnicode), and interns it; attrgetter did this already, and I tweaked methodcaller to match for correctness and performance reasons
2. I added proper repr functionality to all three objects. Partially this is just to make it look nicer, but it was also a decent way to spot verify that the pickle/unpickle sequence behaved correctly

Anyone care to review?

----------
keywords: +patch
nosy: +josh.r
versions: +Python 3.4
Added file: http://bugs.python.org/file37313/pickle_getter_and_caller.patch

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


More information about the Python-bugs-list mailing list