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/021849.html below:

R: [Python-Dev] Deprecating string exceptions

R: [Python-Dev] Deprecating string exceptionsGuido van Rossum guido@python.org
Thu, 28 Mar 2002 10:11:17 -0500
> Just to make sure I'm not missing something (I probably am), I still think
> the recommended catch-all except construct should become "except
> StandardError:" with KeyboardInterrupt migrated to inherit from Exception
> instead of StandardError.

I think I didn't pay attention when that was being discussed before.
I definitely don't like to make "except:" mean anyting besides "catch
*all* exceptions."

There are too many different use cases to favor a specific
non-obvious; for example, the runcode() method in class
InteractiveInterpreter() in code.py needs to catch all exceptions
including KeyboardInterrupt but excluding SystemExit.  Also note that
StopIteration and the warning categories don't derive from
StandardError; but if any of these is accidentally raised, I'd want my
"except:" clause to catch it!  And, while sometimes it's confusing
that SystemExit is caught by "except:", it's really hard to debug why
your program exits without any warning or traceback when a rogue
library function raises SystemExit.

--Guido van Rossum (home page: http://www.python.org/~guido/)



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