summaryrefslogtreecommitdiffstats
path: root/Include/object.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-04-07 23:42:27 (GMT)
committerGitHub <noreply@github.com>2020-04-07 23:42:27 (GMT)
commit45ec5b99aefa54552947049086e87ec01bc2fc9a (patch)
tree991c703174190872d806ae18387e69d62ff69c76 /Include/object.h
parentef5c615f5ae72c4f6979159c94da46afefbfab9a (diff)
downloadcpython-45ec5b99aefa54552947049086e87ec01bc2fc9a.zip
cpython-45ec5b99aefa54552947049086e87ec01bc2fc9a.tar.gz
cpython-45ec5b99aefa54552947049086e87ec01bc2fc9a.tar.bz2
bpo-40170: PyType_HasFeature() now always calls PyType_GetFlags() (GH-19378)
PyType_HasFeature() now always calls PyType_GetFlags() to hide implementation details. Previously, it accessed directly the PyTypeObject.tp_flags member when the limited C API was not used. Add fast inlined version _PyType_HasFeature() and _PyType_IS_GC() for object.c and typeobject.c.
Diffstat (limited to 'Include/object.h')
-rw-r--r--Include/object.h4
1 files changed, 0 insertions, 4 deletions
diff --git a/Include/object.h b/Include/object.h
index 6b6c66a..564ba29 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -614,11 +614,7 @@ times.
static inline int
PyType_HasFeature(PyTypeObject *type, unsigned long feature) {
-#ifdef Py_LIMITED_API
return ((PyType_GetFlags(type) & feature) != 0);
-#else
- return ((type->tp_flags & feature) != 0);
-#endif
}
#define PyType_FastSubclass(type, flag) PyType_HasFeature(type, flag)