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

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

[Python-Dev] Inconsistent exception for read-only properties?Jack Diederich jack at performancedrivers.com
Sun Apr 17 17:53:31 CEST 2005
On Sat, Apr 16, 2005 at 07:24:27PM -0400, Barry Warsaw wrote:
> On Thu, 2005-04-14 at 23:46, Barry Warsaw wrote:
> > I've noticed an apparent inconsistency in the exception thrown for
> > read-only properties for C extension types vs. Python new-style
> > classes.
> 
> I haven't seen any follow ups on this, so I've gone ahead and posted a
> patch, assigning it to Raymond:
> 
> http://sourceforge.net/tracker/index.php?func=detail&aid=1184449&group_id=5470&atid=105470
> 
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.

If that's acceptable I'll gladly submit a similar patch for mmap.get_byte()
  PyErr_SetString (PyExc_ValueError, "read byte out of range");
has always irked me (the same thing with mmap[i] is an IndexError).
I hadn't thought of a clean way to fix it, but MI on the error might work.

-jackdied
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