diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-08-24 03:26:23 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-08-24 03:26:23 (GMT) |
commit | 17689991e6ef5831eae57b2e91f178256d6d3ccb (patch) | |
tree | 21a954c86d8f461ecc06d8c6de8880429c6e97ec /Doc/library/functions.rst | |
parent | 9cf5ef4cc0015848ef831db31b19c77e6a4273e0 (diff) | |
download | cpython-17689991e6ef5831eae57b2e91f178256d6d3ccb.zip cpython-17689991e6ef5831eae57b2e91f178256d6d3ccb.tar.gz cpython-17689991e6ef5831eae57b2e91f178256d6d3ccb.tar.bz2 |
only catch AttributeError in hasattr() #9666
Diffstat (limited to 'Doc/library/functions.rst')
-rw-r--r-- | Doc/library/functions.rst | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 15f7dd1..814bf66 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -463,10 +463,10 @@ are always available. They are listed here in alphabetical order. .. function:: hasattr(object, name) - The arguments are an object and a string. The result is ``True`` if the string - is the name of one of the object's attributes, ``False`` if not. (This is - implemented by calling ``getattr(object, name)`` and seeing whether it raises an - exception or not.) + The arguments are an object and a string. The result is ``True`` if the + string is the name of one of the object's attributes, ``False`` if not. (This + is implemented by calling ``getattr(object, name)`` and seeing whether it + raises an :exc:`AttributeError` or not.) .. function:: hash(object) |