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

[Python-Dev] Proposed resolutions for open PEP 343 issues

[Python-Dev] Proposed resolutions for open PEP 343 issues [Python-Dev] Proposed resolutions for open PEP 343 issuesMichael Chermside mcherm at mcherm.com
Wed Oct 26 17:32:46 CEST 2005
Guido writes:
> I find "AttributeError: __exit__" just as informative.

Eric Nieuwland responds:
> I see. Then why don't we unify *Error into Error?
> Just read the message and know what it means.
> And we could then drop the burden of exception classes and only use the
> message.
> A sense of deja-vu comes over me somehow ;-)

The answer (and there _IS_ an answer) is that using different exception
types allows the user some flexibility in CATCHING the exceptions. The
discussion you have been following obscures that point somewhat because
there's little meaningful difference between TypeError and
AttributeError (at least in well-written code that doesn't have
unnecessary typechecks in it).

If there were a significant difference between TypeError and
AttributeError then Nick and Guido would have immediately chosen the
appropriate error type based on functionality rather than style, and
there wouldn't have been any need for discussion.

Oh yeah, and you can also put extra info into an exception object
besides just the error message. (We don't do that as often as we
should... it's a powerful technique.)

-- Michael Chermside

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