Neal Becker <[EMAIL PROTECTED]> writes:

> One thing I sometimes miss, which is common in some other languages (c++),
> is idea of block scope.  It would be useful to have variables that did not
> outlive their block, primarily to avoid name clashes.  This also leads to
> more readable code.  

I have on occassion used lambda as a poor-man's let, but only if I needed to
avoid multiple evaluation:

 res = (lambda x=blah(...), y=blahz(...):  f(x*y,x+y))()

I'm sure most people would debate it's more readable, but it's IMO superior to
cleaning up manually with ``del``. I sometimes also find it useful to avoid
cluttering up the interactive shell.

'as
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to