A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-April/053111.html below:

[Python-Dev] PEP 340 - possible new name for block-statement

[Python-Dev] PEP 340 - possible new name for block-statement [Python-Dev] PEP 340 - possible new name for block-statementNeil Schemenauer nas at arctrix.com
Fri Apr 29 04:35:39 CEST 2005
On Thu, Apr 28, 2005 at 03:55:03PM -0700, Guido van Rossum wrote:
> A variation on this with somewhat different semantics swaps the keywords:
> 
>     in EXPR for VAR:
>         BLOCK

Looks weird to my eyes.

On a related note, I was thinking about the extra cleanup 'block'
provides.  If the 'file' object would provide a suitable iterator,
you could write:

    block open(filename) as line:
        ...

and have the file closed at the end of the block.  It does not read
so well though.  In a way, it seems to make more sense if 'block'
called iter() on the expression and 'for' did not.  block would
guarantee to cleanup iterators that it created.  'for' does not but
implictly creates them.

  Neil
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4