Re: A friendlier, sugarier lambda -- a proposal for Ruby-like blocks in python

2006-10-14 Thread brenocon
Kay Schluehr wrote: > The with statement is already implemented in Python 2.5. > > http://docs.python.org/whatsnew/pep-343.html > > The main difference between the with statement and Ruby blocks is that > the with-statement does not support loops. Yielding a value of a > function decorated with a c

Re: A friendlier, sugarier lambda -- a proposal for Ruby-like blocks in python

2006-10-13 Thread brenocon
[repost -- fixed formatting] Hi all -- Compared to the Python I know and love, Ruby isn't quite the same. However, it has at least one terrific feature: "blocks". Whereas in Python a "block" is just several lines of locally-scoped-together code, in Ruby a "block" defines a closure (anonymous func

A friendlier, sugarier lambda -- a proposal for Ruby-like blocks in python

2006-10-13 Thread brenocon
Hi all -- Compared to the Python I know and love, Ruby isn't quite the same. However, it has at least one terrific feature: "blocks". Whereas in Python a "block" is just several lines of locally-scoped-together code, in Ruby a "block" defines a closure (anonymous function). To avoid confusion le