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

2013年10月17日 13:33:40 -0700

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~
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to