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/2013-October/129672.html below:

[Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())

[Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore()) [Python-Dev] On suppress()'s trail blazing (was Re: cpython: Rename contextlib.ignored() to contextlib.ignore())Ethan Furman ethan at stoneleaf.us
Thu Oct 17 22:11:10 CEST 2013
On 10/17/2013 01:03 PM, Terry Reedy wrote:
>
> class suppress:
>    def __init__(self, *exceptions):
>      self.exceptions = exceptions
>    def __exit__(self, etype, eval, etrace):
>      return etype in self.exceptions

This fails when etype is a subclass of the exceptions, as mentioned in the original issue.

--
~Ethan~
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