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/2005-August/055607.html below:

[Python-Dev] Bare except clauses in PEP 348

[Python-Dev] Bare except clauses in PEP 348 [Python-Dev] Bare except clauses in PEP 348Nick Coghlan ncoghlan at gmail.com
Wed Aug 24 11:26:02 CEST 2005
Raymond Hettinger wrote:
> The latest version of PEP 348 still proposes that a bare except clause
> will default to Exception instead of BaseException.  Initially, I had
> thought that might be a good idea but now think it is doomed and needs
> to be removed from the PEP.

One thing I assumed was that _if_ bare excepts were kept, they would still 
only be allowed as the last except clause.

That is, this example:
>   try:     ...
>   except:  ...     # A bare except in the middle.  WTF?
>   except (KeyboardInterrupt, SystemExit): ...

would still be a syntax error, even if bare excepts were allowed.

I still have some qualms about the idea of a bare except that doesn't catch 
everything (I'd prefer to see them gone altogether), but I don't mind quite as 
much if the above code stays as a syntax error.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://boredomandlaziness.blogspot.com
More information about the Python-Dev mailing list

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