Message38717
Curse me for a fool. I reported this exact same thing
in getattr but failed to
look 30 lines down to notice hasattr.
hasattr(foo, 'bar') catches all exceptions. I think it
should only catch
AttributeError. Example:
>>> class Foo:
... def __getattr__(self, attr):
... assert 0
...
>>> f = Foo()
>>> hasattr(f, 'bar')
0 # should have gotten an AssertionError
>>>
This patch makes hasattr only catch AttributeError. I
changed the
docstring to reflect that, and also changed the getattr
docstring
to read a little more naturally.
|
|
Date |
User |
Action |
Args |
2007-08-23 15:10:34 | admin | link | issue504714 messages |
2007-08-23 15:10:34 | admin | create | |
|