Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

Good point. That code was originally added in issue420304 because every 
exception raised in PyObject_GetAttr() (including a TypeError for non-string 
name) was silenced in hasattr() and 3-argument getattr(). It was changed in 
Python 3, so this code duplication is no longer needed.

The name of the function was added in error messages in 
a9b9c9fa9fe9d1ae74ba9f89c43557a7f9bc04f5. Now it will gone. It is a minor 
regression, but I think that it is fine. Not all error messages contain a 
function name. In this case the context is clear from the traceback, and the 
error is not specific to these two functions, setattr() and delattr() raise the 
same error.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44024>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to