Nick Coghlan added the comment:

Most of the time when I'm working heavily with exceptions it's something 
related to contextlib, so I'm likely getting my exception details from either 
sys.exc_info() or the arguments to __exit__. That means I start out with an 
exception triple, and the only time I need to look at type(exc) or 
exc.__traceback__ is when I'm following exception chains.

However, Antoine's right that if you got your exception from an *except clause* 
rather than one of the more indirect APIs, then you're just going to have the 
exception, rather than an exception triple.

So I think that's where the argument for accepting "exception-or-triple" comes 
from: handling an exception directly is for use with except clauses, while 
handling triples is convenient for use with sys.exc_info(), __exit__ methods 
and for general backwards compatibility.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17911>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to