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

[Python-Dev] Breaking bug #411881 into manageable pieces

[Python-Dev] Breaking bug #411881 into manageable pieces [Python-Dev] Breaking bug #411881 into manageable piecesGuido van Rossum guido@python.org
Thu, 21 Mar 2002 08:18:21 -0500
> Why can't we simply change the default for bare except clauses?

Because there's too much code that depends on it.

> I.e.
> 
> try:
>     ...
> except:
>     ...
> 
> gets equivalent to
> 
> try:
>     ...
> except StandardError:
>     ...
> 
> To catch everything, write:
> 
> try:
>     ...
> except Exception:
>     ...

Not all exception classes derive from Exception.

> What about string exceptions?

Another good reason not to change the default.  These won't be removed
from the language until Python 3.0 -- there's simply too much legacy
code that uses it.  (We should try to issue warnings when a string
exception is raised or tested for though starting in 2.3.)

--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