File indexing completed on 2025-11-19 09:50:44
0001 #ifndef Py_INTERNAL_ABSTRACT_H
0002 #define Py_INTERNAL_ABSTRACT_H
0003 #ifdef __cplusplus
0004 extern "C" {
0005 #endif
0006
0007 #ifndef Py_BUILD_CORE
0008 # error "this header requires Py_BUILD_CORE define"
0009 #endif
0010
0011
0012 static inline int
0013 _PyIndex_Check(PyObject *obj)
0014 {
0015 PyNumberMethods *tp_as_number = Py_TYPE(obj)->tp_as_number;
0016 return (tp_as_number != NULL && tp_as_number->nb_index != NULL);
0017 }
0018
0019 PyObject *_PyNumber_PowerNoMod(PyObject *lhs, PyObject *rhs);
0020 PyObject *_PyNumber_InPlacePowerNoMod(PyObject *lhs, PyObject *rhs);
0021
0022 extern int _PyObject_HasLen(PyObject *o);
0023
0024
0025
0026 #define PY_ITERSEARCH_COUNT 1
0027 #define PY_ITERSEARCH_INDEX 2
0028 #define PY_ITERSEARCH_CONTAINS 3
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041 extern Py_ssize_t _PySequence_IterSearch(PyObject *seq,
0042 PyObject *obj, int operation);
0043
0044
0045
0046 extern int _PyObject_RealIsInstance(PyObject *inst, PyObject *cls);
0047
0048 extern int _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls);
0049
0050
0051
0052 PyAPI_FUNC(int) _Py_convert_optional_to_ssize_t(PyObject *, void *);
0053
0054
0055
0056 PyAPI_FUNC(PyObject*) _PyNumber_Index(PyObject *o);
0057
0058 #ifdef __cplusplus
0059 }
0060 #endif
0061 #endif