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

hasattr() can return True, False, or raise an exception. But PyObject_HasAttr() 
just returns an integer: 0 for False, not 0 for True. There is no way to return 
an error, and existing code doesn't expect that PyObject_HasAttr() returns an 
error. Leaking an exception from PyObject_HasAttr() will break existing code.

----------

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

Reply via email to