Re: [Python-Dev] Ruby-style Blocks in Python

2009-03-08 Thread Henning von Bargen
I totally agree with Matthew. I don't understand the code at first sight. The "with ... do ..." syntax breaks the "Python is executable pseudo-code" pattern. And according the example given at Tav's web site: with employees.select do (emp): if emp.salary > developer.salary: return fire

Re: [Python-Dev] Ruby-style Blocks in Python [Pseudo-PEP]

2009-03-08 Thread Guido van Rossum
On Sun, Mar 8, 2009 at 8:13 AM, tav wrote: > Apologies for bringing up an old issue, but I think I've worked out a > Pythonic syntax for doing Ruby-style blocks. As a point of order, please move this discussion to python-ideas, where it belongs roughly until the time a PEP might be ready for appr

Re: [Python-Dev] Ruby-style Blocks in Python [Pseudo-PEP]

2009-03-08 Thread Matthew Wilkes
On 8 Mar 2009, at 15:13, tav wrote: Apologies for bringing up an old issue, but I think I've worked out a Pythonic syntax for doing Ruby-style blocks. The short of it is: with employees.select do (emp): if emp.salary > developer.salary: return fireEmployee(emp) else

Re: [Python-Dev] Ruby-style Blocks in Python [Pseudo-PEP]

2009-03-08 Thread Antoine Pitrou
tav espians.com> writes: > > Apologies for bringing up an old issue, but I think I've worked out a > Pythonic syntax for doing Ruby-style blocks. The short of it is: > [...] This thread should probably be redirected to python-ideas. Regards Antoine. __

Re: [Python-Dev] Ruby-style Blocks in Python [Pseudo-PEP]

2009-03-08 Thread Duncan Booth
tav wrote: > I explain in detail in this blog article: > > http://tav.espians.com/ruby-style-blocks-in-python.html > "This is also possible in Python but at the needless cost of naming and defining a function first" The cost of defining the function first is probably much less than the cos