[Python-ideas] Improving Catching Exceptions

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Jun 23 21:14:43 EDT 2017


Cameron Simpson wrote:

> A shallow catch would effectively need to mean "the exceptions uppermost 
> traceback frame referers to one of the program lines in the try/except 
> suite".  Which would work well for lists and other builtin types. And 
> might be insufficient for a duck-type with python-coded dunder methods.

I think it would be a very bad idea to have a language construct
that only works for built-in types. It would be far too unpredictable
and fragile.

-- 
Greg


More information about the Python-ideas mailing list