Reinhold Birkenfeld wrote:
Shane Hathaway wrote:
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?

This could be solved if the translation of
<x-tad-bigger>
block EXPR1 as VAR1:
BLOCK1
</x-tad-bigger>
would change from:
<x-tad-bigger> itr = EXPR1 # The iterator
ret = False # True if a return statement is active
...etc...
</x-tad-bigger>
to:
<x-tad-bigger> itr = iter(EXPR1) # The iterator
ret = False # True if a return statement is active
...etc...

--eric</x-tad-bigger>
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to