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/2012-March/117436.html below:

[Python-Dev] Request for clarification of PEP 380

[Python-Dev] Request for clarification of PEP 380Mark Shannon mark at hotpy.org
Thu Mar 8 15:06:17 CET 2012
Hi,

The scenario is this:
A generator, G, has a non-generator sub-iterator, S,
(ie G includes a "yield from S" experssion and S is not a generator)
and either G.close() or G.throw(GeneratorExit) is called.

In the current implementation, S.close() is called and,
if that call raises an exception, then that exception is suppressed.

Should close() be called at all? I know that it helps non-generators
to support the protocol, but there is the problem of iterables that 
happen to have a close method. This may cause unwanted side effects.

Why is the exception suppressed?

The text of the PEP seems to implicitly assume that all sub-iterators
will be generators, so it is not clear on the above points.

Cheers,
Mark.
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