[Patches] Change to attribute error message for instances.

M.-A. Lemburg mal@lemburg.com
Mon, 10 Apr 2000 20:05:42 +0200


David Ascher wrote:
> 
> > One problem with this: it breaks test_extcall.py!!!  That code was
> > expecting just the attribute name as the exception message.
> >
> > I wonder if there's more (user) code that makes a similar exception?
> 
> Probably.  IMO, tough.
> 
> > I think we may have to be careful with this (kind of) change...  At
> > the very least I'll mention it in the list of code breakage on
> > python.org/1.6/.
> 
> Sure, but I want to point out that this kind of change is what helps newbies
> more than almost anything else -- Python's error messages are liked by folks
> who have to deal with bad C compilers on a daily basis, but hated by real
> newbies.
> 
> As far as I know, the content of the message of AttributeError was never
> documented, right?

Not sure, but aren't the error objects supposed to carry
this kind of additional infomation in error instance attributes ?!
The text should really never be used in other ways than to
write it to a log file or print it to stderr, IMHO...

-- 
Marc-Andre Lemburg
______________________________________________________________________
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/