bpo-40170: Convert PyDescr_IsData() to static inline function (GH-24535) · python/cpython@871eb42 · GitHub
Skip to content

Commit 871eb42

Browse files
author
Erlend Egeberg Aasland
authored
bpo-40170: Convert PyDescr_IsData() to static inline function (GH-24535)
1 parent 8a8b5df commit 871eb42

4 files changed

Lines changed: 11 additions & 3 deletions

File tree

Doc/c-api/descriptor.rst

Lines changed: 2 additions & 2 deletions

Include/descrobject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ PyAPI_FUNC(PyObject *) PyDescr_NewGetSet(PyTypeObject *,
9393
#ifndef Py_LIMITED_API
9494
PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *,
9595
struct wrapperbase *, void *);
96-
#define PyDescr_IsData(d) (Py_TYPE(d)->tp_descr_set != NULL)
96+
PyAPI_FUNC(int) PyDescr_IsData(PyObject *);
9797
#endif
9898

9999
PyAPI_FUNC(PyObject *) PyDictProxy_New(PyObject *);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Convert :c:func:`PyDescr_IsData` macro to a function to hide implementation
2+
details: The macro accessed :c:member:`PyTypeObject.tp_descr_set` directly.
3+
Patch by Erlend E. Aasland.

Objects/descrobject.c

Lines changed: 5 additions & 0 deletions

0 commit comments

Comments
 (0)