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

[Python-Dev] Re: anonymous blocks

[Python-Dev] Re: anonymous blocks [Python-Dev] Re: anonymous blocksGuido van Rossum gvanrossum at gmail.com
Wed Apr 27 23:57:01 CEST 2005
> If the iterator fails to re-raise the StopIteration exception (the spec
> only says it should, not that it must) I think the return would be ignored
> but a subsquent exception would then get converted into a return value. I
> think the flag needs reset to avoid this case.

Good catch. I've fixed this in the PEP.

> Also, I wonder whether other exceptions from next() shouldn't be handled a
> bit differently. If BLOCK1 throws an exception, and this causes the
> iterator to also throw an exception then one exception will be lost. I
> think it would be better to propogate the original exception rather than
> the second exception.

I don't think so. It's similar to this case:

    try:
        raise Foo
    except:
        raise Bar

Here, Foo is also lost.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
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