Message4573
Logged In: YES
user_id=31435
Oh no: getattr hooks can raise any exception whatsoever,
and existing code relies on getattr() treating any
exception whatsoever as meaning "no attribute of that
name". For example, IndexError and KeyError are often
raised naturally by getattr hooks that fail to resolve a
name via tree or dict structures.
The specific complaint here is a different story: the docs
say the attribute argument must be a string (Unicode,
whatever -- "a string" <wink>), and I agree that calling
getattr() with something other than a string argument
should raise a TypeError instead of pretending it's a
*possible* attribute name and that there simply isn't any
attribute with that name (it's not a name at all, so the
call doesn't make sense).
Jeremy, I see this is assigned to you now. There are
enough conflicting opinions here (at least Michael's and
mine seem to coincide) that perhaps it's time to dump it on
Guido for Pronouncement. |
|
Date |
User |
Action |
Args |
2007-08-23 13:54:25 | admin | link | issue420304 messages |
2007-08-23 13:54:25 | admin | create | |
|