Message354965
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. |
|
Date |
User |
Action |
Args |
2019-10-19 20:56:01 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, vstinner, james, pablogsal, xtreak, BTaskaya |
2019-10-19 20:56:01 | serhiy.storchaka | set | messageid: <1571518561.18.0.845747919098.issue38530@roundup.psfhosted.org> |
2019-10-19 20:56:01 | serhiy.storchaka | link | issue38530 messages |
2019-10-19 20:56:00 | serhiy.storchaka | create | |
|