This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eli.bendersky
Recipients Arfrever, danielsh, einarfd, eli.bendersky, ezio.melotti, flox, georg.brandl, jcea, larry, python-dev, santoso.wijaya, skrah
Date 2013-01-08.23:13:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAF-Rda9sU-h4ft1dxoyVt-iUFbys5NLDBp2-To_k7_FZsPX04g@mail.gmail.com>
In-reply-to <20130108225134.GJ3822@lp-shahaf.local>
Content
On Tue, Jan 8, 2013 at 2:51 PM, Daniel Shahaf <report@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...
History
Date User Action Args
2013-01-08 23:13:59eli.benderskysetrecipients: + eli.bendersky, georg.brandl, jcea, larry, ezio.melotti, Arfrever, skrah, flox, santoso.wijaya, python-dev, einarfd, danielsh
2013-01-08 23:13:59eli.benderskylinkissue16076 messages
2013-01-08 23:13:58eli.benderskycreate