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-May/053352.html below:

[Python-Dev] PEP 340 -- loose ends

[Python-Dev] PEP 340 -- loose ends [Python-Dev] PEP 340 -- loose endsReinhold Birkenfeld reinhold-birkenfeld-nospam at wolke7.net
Wed May 4 21:53:50 CEST 2005
Shane Hathaway wrote:

> For each block statement, it is necessary to create a *new* iterator,

Right.

> since iterators that have stopped are required to stay stopped.  So at a
> minimum, used-defined statements will need to call something, and thus
> will have parentheses.  The parentheses might be enough to make block
> statements not look like built-in keywords.
> 
> PEP 340 seems to punish people for avoiding the parentheses:
> 
>     transaction = begin_transaction()
> 
>     transaction:
>         db.execute('insert 3 into mytable')
> 
>     transaction:
>         db.execute('insert 4 into mytable')
> 
> I expect that only '3' would be inserted in mytable.  The second use of
> the transaction iterator will immediately raise StopIteration.

Yes, but wouldn't you think that people would misunderstand it in this way?

Reinhold

-- 
Mail address is perfectly valid!

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