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

[Python-Dev] Inconsistent exception for read-only properties?

[Python-Dev] Inconsistent exception for read-only properties?Aahz aahz at pythoncraft.com
Sun Apr 17 18:25:09 CEST 2005
On Sun, Apr 17, 2005, Barry Warsaw wrote:
> On Sun, 2005-04-17 at 11:53, Jack Diederich wrote:
>> 
>> In 2.4 & 2.3 does it make sense to raise an exception that multiply
>> inherits from both TypeError and AttributeError?  If anyone currently
>> does catch the error raising only AttributeError will break their
>> code.  2.5 should just raise an AttributeError, of course.
>
> Without introducing a new exception class (which I think is out of the
> question for anything but 2.5), the only common base is StandardError,
> which seems too general for this exception.

Why is changing an exception more acceptable than creating a new one?
(I don't have a strong opinion either way, but I'd like some reasoning;
Jack's approach at least doesn't break code.)  Especially if the new
exception isn't "public" (in the builtins with other exceptions).
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"The joy of coding Python should be in seeing short, concise, readable
classes that express a lot of action in a small amount of clear code -- 
not in reams of trivial code that bores the reader to death."  --GvR
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