A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2006-March/062618.html below:

[Python-Dev] GeneratorExit inheriting from Exception

[Python-Dev] GeneratorExit inheriting from Exception [Python-Dev] GeneratorExit inheriting from ExceptionGiovanni Bajo rasky at develer.com
Sun Mar 19 12:43:33 CET 2006
Nick Coghlan <ncoghlan at gmail.com> wrote:

> Rather than trying to change course midstream, I *like* the fact that
> the PEP 352 hierarchy introduces BaseException to bring the language
> itself into line with what people have already been taught. Breaking
> things in Py3k is all well and good, but breaking them gratuitously
> is something else entirely :)

I really like this too, but Barry's proposal doesn't really *break* anything.
Existing Python code that creates a FooBar(Exception) and then catches it with
either "except FooBar:" or "except Exception, e:" + check for FooBar, will
still work as expected. At *worse*, it would be catching too much, like
SystemExit or GeneratorExit, which are still pretty uncommon exception.

OTOH, I also understand that people have been told that deriving from Exception
is the right thing to do forever now.

Giovanni Bajo

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