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 ethan.furman
Recipients amaury.forgeotdarc, ethan.furman, facundobatista, jcea, r.david.murray
Date 2013-10-16.23:35:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1381966520.18.0.783243100344.issue19272@psf.upfronthosting.co.za>
In-reply-to
Content
From the pickle docs:

=====================================================================
Note that functions (built-in and user-defined) are pickled by “fully
qualified” name reference, not by value.  This means that only the
function name is pickled, along with the name of the module the
function is defined in. Neither the function’s code, nor any of its
function attributes are pickled. Thus the defining module must be
importable in the unpickling environment, and the module must contain
the named object, otherwise an exception will be raised. 

Similarly, classes are pickled by named reference, ...
=====================================================================

There is no bug here; there /may/ be a doc clarification here.

However, if we're talking about enhancing pickle we can take 3.3 off the table, and unless somebody gets busy quick 3.4 as well.

Personally, I don't see the need.  Just define your functions at the top level (with def, not lambda -- lambda functions are anonymous and don't have a useful __name__ attribute).
History
Date User Action Args
2013-10-16 23:35:20ethan.furmansetrecipients: + ethan.furman, facundobatista, jcea, amaury.forgeotdarc, r.david.murray
2013-10-16 23:35:20ethan.furmansetmessageid: <1381966520.18.0.783243100344.issue19272@psf.upfronthosting.co.za>
2013-10-16 23:35:20ethan.furmanlinkissue19272 messages
2013-10-16 23:35:19ethan.furmancreate