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.
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