[Python-ideas] Anonymous blocks (again):

Juancarlo Añez apalala at gmail.com
Mon May 13 17:09:49 CEST 2013


On Mon, May 13, 2013 at 12:17 AM, Steven D'Aprano <steve at pearwood.info>wrote:

> with context():
>     while condition: # or a for loop
>         block of code goes here
>
>
> If you want something different to this, then I think you do want new
> syntax. Otherwise, what do you gain beyond what can already be done now?
>
> Or am I missing something?
>

It's not obvious from my example, but the idea is that the invoker be able
to provide context for _each_ iteration.

Cheers,


-- 
Juancarlo *Añez*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130513/8e02be72/attachment.html>


More information about the Python-ideas mailing list