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.

Author serhiy.storchaka
Recipients BTaskaya, james, pablogsal, serhiy.storchaka, vstinner, xtreak
Date 2019-10-19.20:56:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1571518561.18.0.845747919098.issue38530@roundup.psfhosted.org>
In-reply-to
Content
AFAIK there is existing issue for this idea.

I have doubts about performance. I added _PyObject_LookupAttr in particularly to avoid an overhead of raising and silencing an AttributeError. I believe most performance sensitive code in the core now uses it and will not be affected, but there is other code which silences it (_PyObject_LookupAttr itself silences an AttributeError raised in called functions), third-party code which uses PyObject_HasAttr or PyObject_GetAttr can be affected.

It might be simpler to implement it in sys.excepthook or sys.displayhook, but at that point we do not have attribute name and a reference to the object. There is an issues and a PEP about adding references to AttributeError. It could help to implement this feature.
History
Date User Action Args
2019-10-19 20:56:01serhiy.storchakasetrecipients: + serhiy.storchaka, vstinner, james, pablogsal, xtreak, BTaskaya
2019-10-19 20:56:01serhiy.storchakasetmessageid: <1571518561.18.0.845747919098.issue38530@roundup.psfhosted.org>
2019-10-19 20:56:01serhiy.storchakalinkissue38530 messages
2019-10-19 20:56:00serhiy.storchakacreate