|laziness, impatience, and hubris|
Re^4: RFC: Simulating Ruby's "yield" and "blocks" in Perl (Python)by LanX (Bishop)
|on Apr 24, 2013 at 04:19 UTC||Need Help??|
> FWIW, the equivalent in idiomatic Python3 is:
Thanks, interesting idea to turn it inside out!¹ =)
But why Python3, AFAIK generators were already introduced in 2.
> while back a monstrosity was released...
Thanks, even more fun! =)
Especially the last line (after "bugs and limitations")
Oh, and almost forgot: We are sorry, Guido. So sorry.
( addicted to the Perl Programming Language)
¹) while its a bit cumbersome that you need to iterate over the yields... ... why not using a decorator to abstract the loop away?
this worked for me in Py 2.5.2