Issue 9666: 'hasattr' fix to suppress only AttributeError - Python tracker

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: benjamin.peterson Nosy List: Yury.Selivanov, benjamin.peterson, docs@python, jcea
Priority: normal Keywords: gsoc

Created on 2010-08-24 02:56 by Yury.Selivanov, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
hasattr.patch Yury.Selivanov, 2010-08-24 02:56
Messages (2)
msg114767 - (view) Author: Yury Selivanov (Yury.Selivanov) * Date: 2010-08-24 02:56
As discussed on python-dev mailing list (http://mail.python.org/pipermail/python-dev/2010-August/103178.html), 'hasattr' default behaviour should be changed to suppress only AttributeError exceptions.  Other should pass through.

The fix, however, shouldn't change behaviour of existing C API, functions PyObject_HasAttr and PyObject_HasAttrString in particular.

I'm targeting this issue on Python 3.2 version, but probably it may be introduced in the next Python 3.1 maintenance release.
msg114768 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2010-08-24 03:27
Fixed in r84294. I will not backport to 3.1. Thanks for the contribution!