mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
bpo-35461: Document C API functions which suppress exceptions. (GH-11119)
This commit is contained in:
parent
62a68b762a
commit
3fcc1e08db
7 changed files with 35 additions and 4 deletions
|
|
@ -33,6 +33,10 @@ Object Protocol
|
|||
is equivalent to the Python expression ``hasattr(o, attr_name)``. This function
|
||||
always succeeds.
|
||||
|
||||
Note that exceptions which occur while calling :meth:`__getattr__` and
|
||||
:meth:`__getattribute__` methods will get suppressed.
|
||||
To get error reporting use :c:func:`PyObject_GetAttr()` instead.
|
||||
|
||||
|
||||
.. c:function:: int PyObject_HasAttrString(PyObject *o, const char *attr_name)
|
||||
|
||||
|
|
@ -40,6 +44,11 @@ Object Protocol
|
|||
is equivalent to the Python expression ``hasattr(o, attr_name)``. This function
|
||||
always succeeds.
|
||||
|
||||
Note that exceptions which occur while calling :meth:`__getattr__` and
|
||||
:meth:`__getattribute__` methods and creating a temporary string object
|
||||
will get suppressed.
|
||||
To get error reporting use :c:func:`PyObject_GetAttrString()` instead.
|
||||
|
||||
|
||||
.. c:function:: PyObject* PyObject_GetAttr(PyObject *o, PyObject *attr_name)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue