What are the differences between Ruby's blocks and Python's l ambdas?

Greg Ewing (using news.cis.dfn.de) wrote:[mailto:me@privacy.net]

The main one is that a Python lambda can only contain
an expression, whereas a Ruby block can contain arbitrary statements.

If that restriction were lifted one day (discussions
come up periodically about doing that somehow) there
would remain another difference – in Python, names
cannot be rebound in a lexically enclosing local
scope.

?:open_mouth:

sir Greg, can you provide sample, pls.

–
Greg Ewing, Computer Science Dept,

kind regards -botp