Manuel Alejandro Cerón Estrada wrote:
> Acording to PEP 255:
>
> Note that return isn't always equivalent to raising StopIteration: the
> difference lies in how enclosing try/except constructs are treated.
All that means is that
def g():
try:
if 0:
yield
return
except StopIteration:
print "Spam"
won't print "Spam". But since this involves catching the
exception with an explicit try-except, it doesn't fall
under the scope of your complaint.
> Of curse, the problem of low level details it's solved by 'yield break'
I would put it the other way around -- the problem
that 'yield break' is meant to solve is already solved
by 'return'. So there's no need for change.
--
Greg
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com