dynamic functions

Uwe Mayer merkosh at hadiko.de
Mon May 13 20:08:18 EDT 2002


Hi,

I want to concatenate boolean functions, i.e. lambda x: x < 10; during 
runtime with "and" and "or".
However something like:

d = lambda x: x < 10
d = lambda x: d(x) and (x %2 == 0)

won't work and will end up in an infinite recursion (as far as I can 
figure out).
How do you do something like that in python?

Thanks in advance
Yours
Uwe



More information about the Python-list mailing list