A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-March/021861.html below:

R: [Python-Dev] Deprecating string exceptions

R: [Python-Dev] Deprecating string exceptionsSkip Montanaro skip@pobox.com
Thu, 28 Mar 2002 10:30:26 -0600
    Guido> You're looking at this all wrong.  In the past, we've focused on
    Guido> saying "unqualified except is wrong".  But IMO "except Exception"
    Guido> or "except StandardError" is just as wrong!  You're still
    Guido> catching way more exceptions than is good for you.

Point taken.

    >> * I'm not saying you can't use "except:".  I'm not advocating a
    >>   semantic change to the meaning of "except:".  (I am suggesting that
    >>   KeyboardInterrupt should not inherit from StandardError.)  I'm
    >>   saying that the recommended usage for application programmers
    >>   should be to avoid it.

    Guido> Sorry.  I told you I hadn't read the thread the first time around.

So, do we agree on this point?

    Guido> We should fix the "except:" examples by catching a very specific
    Guido> error, like AttributeError, TypeError or KeyError.  *Not* by
    Guido> catching Exception or StandardError.

Correct.  That's what the long-standing bug #411881 is about.  It just deals
with the standard library however, and doesn't delve into the stuff in
Tools, Demos, etc.

Skip



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4