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

[Python-Dev] Merging PEP 310 and PEP 340-redux?

[Python-Dev] Merging PEP 310 and PEP 340-redux? [Python-Dev] Merging PEP 310 and PEP 340-redux?Shane Hathaway shane at hathawaymix.org
Wed May 11 20:44:19 CEST 2005
Phillip J. Eby wrote:
> FYI, there are still use cases for clearing the exception state in an 
> __exit__ method, that might justify allowing a true return from __exit__ to 
> suppress the error.  e.g.:

Maybe __exit__ could suppress exceptions using a new idiom:

         def __exit__(self,*exc):
             if exc and not last and issubclass(exc[0],self.type):
                 # suppress the exception
                 raise None

This seems clearer than "return True".

Shane
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