paolo_veronelli at yahoo.it
Sat Jul 24 20:58:42 CEST 2004
On Sat, 24 Jul 2004 17:54:09 GMT, max(01)* <max at fisso.casa> wrote:
> max(01)* wrote:
>> i understand than most objects are pickable, but i cannot get a
>> function pickled
> also i would like to know: why in the world would anyone want to pickle
> a builtin function, as the documentation says it's possible?
actually docs explain well that you can't ,at least that way.
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 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.
follow there an explanation of this choice
....lotta dura per la verdura
More information about the Python-list