[Python-ideas] Proposal: Abolition of bare except clauses

Cameron Simpson cs at zip.com.au
Mon Apr 13 00:39:45 CEST 2015


For the record, as a Python 2/3 user of the occasional bare "except:" I was 
against this over on python-list, but Chris and Steven have convinced me 
otherwise. I'm now +0.5 and will probably be +1 in time.

I was using a few bare excepts in boundary code that needed to plough on in the 
face of failures of a callable, but have been convinced that I would be better 
off with "except Exception:" most of the time, and I'm going to put some work 
into stripping out my bare "except:"s and mostly catching Exception and 
possibly reporting BaseException (and reraising) as a debugging/insight aid.

Cheers,
Cameron Simpson <cs at zip.com.au>

Ho, HaHa, Dodge, Parry, Spin, HA! THRUST!       - Daffy Duck


More information about the Python-ideas mailing list