how to pickle a lambda?

Alejandro Dubrovsky s328940 at student.uq.edu.au
Tue Apr 30 00:43:48 EDT 2002


On Tue, 30 Apr 2002 08:17:58 +1000, Kragen Sitaker wrote:


> Unfortunately not.  You can't marshal lambdas either.
> 
> Generally, you can refactor code that uses lambdas into code that uses
> object methods; your closure data goes into object attributes, and each
> lambda becomes a class.  Or you can just use named functions, especially
> if you don't have closure data.
 
i do have closure data, but making it a class seems like a good solution
i hadn't thought about.  Thanks.
Alejandro



More information about the Python-list mailing list