Ethan Furman added the comment:

>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).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19272>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to