Eli Bendersky added the comment: On Tue, Jan 8, 2013 at 2:51 PM, Daniel Shahaf <rep...@bugs.python.org>wrote:
> > Daniel Shahaf added the comment: > > Eli Bendersky wrote on Tue, Jan 08, 2013 at 15:00:42 +0000: > > > > Eli Bendersky added the comment: > > > > P = import_fresh_module('xml.etree.ElementTree', > blocked=['_elementtree']) > > tb = P.TreeBuilder(element_factory=lambda a, b: [a, b]) > > print(pickle.dumps(tb)) > > > > Gives: _pickle.PicklingError: Can't pickle <class 'function'>: attribute > lookup builtins.function failed > > Is that with or without the patch? > Without. Pickle can't handle functions that are not top-level, so bound methods, internal functions, lambdas are all out. So pickling probably wasn't a first priority for the Python version of TreeBuilder as well... ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16076> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com