Re: python contextmanagers and ruby blocks

2009-03-12 Thread Aahz
In article c6b9e335-a04d-44cb-b18e-18a52eef1...@k19g2000yqg.googlegroups.com, Alia K alia_kho...@yahoo.com wrote: Aahz wrote: Longer answer: the way in Python to achieve the full power of Ruby blocks is to write a function. You are most likely right... there is probably no need to introduce

Re: python contextmanagers and ruby blocks

2009-02-22 Thread Francesco Bochicchio
On Sat, 21 Feb 2009 09:42:02 -0800, Aahz wrote: In article aac004f8-2077-4e53-a865-47c24f7f5...@t3g2000yqa.googlegroups.com, Alia K alia_kho...@yahoo.com wrote: Nevertheless, I remain curious about whether once can use the contextmanager in python to achieve the full power of ruby's blocks...

python contextmanagers and ruby blocks

2009-02-21 Thread Alia Khouri
As an exercise, I recently translated one of my python scripts (http:// code.activestate.com/recipes/576643/) to haskell (a penultimate version exists at http://groups.google.com/group/comp.lang.haskell/browse_thread/thread/fb1ebd986b44244e# in case anyone is interested) with the result that

Re: python contextmanagers and ruby blocks

2009-02-21 Thread Francesco Bochicchio
On Sat, 21 Feb 2009 00:46:08 -0800, Alia Khouri wrote: As an exercise, I recently translated one of my python scripts (http:// code.activestate.com/recipes/576643/) to haskell (a penultimate version exists at

Re: python contextmanagers and ruby blocks

2009-02-21 Thread Alia K
Francesco wrote: ... ruby code that shows the most twisted 'Hellow world' example I have ever seen :-) ... and I was gunning for the simplest possible example (-: ... python code doing the same thing - apparently - of prevous ruby code, using context managers in a way that I believe the

Re: python contextmanagers and ruby blocks

2009-02-21 Thread Aahz
In article aac004f8-2077-4e53-a865-47c24f7f5...@t3g2000yqa.googlegroups.com, Alia K alia_kho...@yahoo.com wrote: Nevertheless, I remain curious about whether once can use the contextmanager in python to achieve the full power of ruby's blocks... Short answer: no Longer answer: the way in

Re: python contextmanagers and ruby blocks

2009-02-21 Thread Alia K
Aahz wrote: Longer answer: the way in Python to achieve the full power of Ruby blocks is to write a function. You are most likely right... there is probably no need to introduce ruby-like blocks to python where iteration comes naturally with list comprehensions and generators. But for the