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

[Python-Dev] PEP 340 -- concept clarification

[Python-Dev] PEP 340 -- concept clarification [Python-Dev] PEP 340 -- concept clarificationRaymond Hettinger python at rcn.com
Wed May 4 01:59:31 CEST 2005
> it's not infeasible to add a close() method to
> generators as a shortcut for this:
> 
>     def close(self):
>         try:
>             self.__exit__(StopIteration)
>         except StopIteration:
>             break
>         else:
>             # __exit__() didn't
>             raise RuntimeError("or some other exception")
> 
> I'd like the block statement to be defined exclusively in terms of
> __exit__() though.

That sounds like a winner.



Raymond
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