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

[Python-Dev] PEP 348: Exception Reorganization for Python 3.0

[Python-Dev] PEP 348: Exception Reorganization for Python 3.0James Y Knight foom at fuhm.net
Fri Aug 5 21:42:16 CEST 2005
On Aug 5, 2005, at 2:46 PM, Raymond Hettinger wrote:

> The PEP moves StopIteration out from under Exception so that it cannot
> be caught by a bare except or an explicit "except Exception".
>
> IMO, this is a mistake.  In either form, a programmer is stating that
> they want to catch and handle just about anything.  There is a
> reasonable argument that SystemExit special and should float to the  
> top,
> but that is not the case with StopIteration.

I'm glad you brought that up. I had wondered from the beginning why  
ControlFlowException was moved out, but thought there must be a good  
reason I was just not seeing, and promptly forgot about it. So now  
that I've been reminded, can someone explain to me why StopIteration  
and GeneratorExit should not be caught by an "except:" or "except  
Exception:" clause?

James
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