Message234820
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. |
|
Date |
User |
Action |
Args |
2015-01-27 13:23:04 | ncoghlan | set | recipients:
+ ncoghlan, gvanrossum, rhettinger, pitrou, vstinner, rbcollins, eric.snow, yselivanov, adaptivelogic, martius |
2015-01-27 13:23:04 | ncoghlan | set | messageid: <1422364984.09.0.397768580574.issue17911@psf.upfronthosting.co.za> |
2015-01-27 13:23:04 | ncoghlan | link | issue17911 messages |
2015-01-27 13:23:03 | ncoghlan | create | |
|