Michal wrote:
Today I started with python and I cannot understand why expresion
lambda x: print x
returns syntax error (but for example lambda x: sys.stdio.write(x)
does not)
First I fought the reason is scopeing, but it shouldnt return syntax
error.
The problem is that you can only put an expression in a lambda form.
print is a statement, not an expression. Other examples of statements
are if...else control structures, variable assignments, and return
statements.
--
Erik Max Francis &&
ma*@alcyone.com &&
http://www.alcyone.com/max/
__ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/ \
\__/ Bring me men / Bring me men to match my plains
-- Lamya