Message365795
Macros and static inline functions of the public C API which access directly PyTypeObject fields. There may be more.
#define _PyObject_SIZE(typeobj) ( (typeobj)->tp_basicsize )
static inline vectorcallfunc
PyVectorcall_Function(PyObject *callable)
{
...
tp = Py_TYPE(callable);
offset = tp->tp_vectorcall_offset;
...
}
#define PyObject_CheckBuffer(obj) \
((Py_TYPE(obj)->tp_as_buffer != NULL) && \
(Py_TYPE(obj)->tp_as_buffer->bf_getbuffer != NULL))
#define PyIndex_Check(obj) \
(Py_TYPE(obj)->tp_as_number != NULL && \
Py_TYPE(obj)->tp_as_number->nb_index != NULL)
#define PyObject_GET_WEAKREFS_LISTPTR(o) \
((PyObject **) (((char *) (o)) + Py_TYPE(o)->tp_weaklistoffset))
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 _PyObject_SIZE(typeobj) ( (typeobj)->tp_basicsize ) |
|
Date |
User |
Action |
Args |
2020-04-04 21:45:49 | vstinner | set | recipients:
+ vstinner, corona10, shihai1991, petdance |
2020-04-04 21:45:49 | vstinner | set | messageid: <1586036749.45.0.667886765597.issue40170@roundup.psfhosted.org> |
2020-04-04 21:45:49 | vstinner | link | issue40170 messages |
2020-04-04 21:45:49 | vstinner | create | |
|