For review: PEP 343: Anonymous Block Redux and Generator Enhancements

oren.tirosh at gmail.com oren.tirosh at gmail.com
Sat Jun 4 07:36:43 EDT 2005


Ilpo Nyyssönen wrote:
> Nicolas Fleury <nid_oizo at yahoo.com_remove_the_> writes:
> > def foo():
> >     with locking(someMutex)
> >     with opening(readFilename) as input
> >     with opening(writeFilename) as output
> >     ...
>
> How about this instead:
>
> with locking(mutex), opening(readfile) as input:
>     ...

+1, and add PEP-328-like parentheses for multiline.

  Oren




More information about the Python-list mailing list