1 #ifndef Py_ABSTRACTOBJECT_H
2 #define Py_ABSTRACTOBJECT_H
7 #ifdef PY_SSIZE_T_CLEAN
8 #define PyObject_CallFunction _PyObject_CallFunction_SizeT
9 #define PyObject_CallMethod _PyObject_CallMethod_SizeT
218 #define PyObject_DelAttrString(O,A) PyObject_SetAttrString((O),(A),NULL)
229 #define PyObject_DelAttr(O,A) PyObject_SetAttr((O),(A),NULL)
432 #undef PyObject_Length
434 #define PyObject_Length PyObject_Size
503 Py_ssize_t *buffer_len);
519 Py_ssize_t *buffer_len);
534 #define PyObject_CheckBuffer(obj) \
535 (((obj)->ob_type->tp_as_buffer != NULL) && \
536 (PyType_HasFeature((obj)->ob_type, Py_TPFLAGS_HAVE_NEWBUFFER)) && \
537 ((obj)->ob_type->tp_as_buffer->bf_getbuffer != NULL))
558 PyAPI_FUNC(
int) PyBuffer_SizeFromFormat(const
char *);
569 Py_ssize_t len,
char fort);
596 PyAPI_FUNC(
void) PyBuffer_FillContiguousStrides(
int ndims,
637 #define PyIter_Check(obj) \
638 (PyType_HasFeature((obj)->ob_type, Py_TPFLAGS_HAVE_ITER) && \
639 (obj)->ob_type->tp_iternext != NULL && \
640 (obj)->ob_type->tp_iternext != &_PyObject_NextNotImplemented)
642 PyAPI_FUNC(PyObject *) PyIter_Next(PyObject *);
660 PyAPI_FUNC(PyObject *) PyNumber_Add(PyObject *o1, PyObject *o2);
669 PyAPI_FUNC(PyObject *) PyNumber_Subtract(PyObject *o1, PyObject *o2);
678 PyAPI_FUNC(PyObject *) PyNumber_Multiply(PyObject *o1, PyObject *o2);
688 PyAPI_FUNC(PyObject *) PyNumber_Divide(PyObject *o1, PyObject *o2);
697 PyAPI_FUNC(PyObject *) PyNumber_FloorDivide(PyObject *o1, PyObject *o2);
707 PyAPI_FUNC(PyObject *) PyNumber_TrueDivide(PyObject *o1, PyObject *o2);
717 PyAPI_FUNC(PyObject *) PyNumber_Remainder(PyObject *o1, PyObject *o2);
727 PyAPI_FUNC(PyObject *) PyNumber_Divmod(PyObject *o1, PyObject *o2);
737 PyAPI_FUNC(PyObject *) PyNumber_Power(PyObject *o1, PyObject *o2,
747 PyAPI_FUNC(PyObject *) PyNumber_Negative(PyObject *o);
755 PyAPI_FUNC(PyObject *) PyNumber_Positive(PyObject *o);
763 PyAPI_FUNC(PyObject *) PyNumber_Absolute(PyObject *o);
771 PyAPI_FUNC(PyObject *) PyNumber_Invert(PyObject *o);
781 PyAPI_FUNC(PyObject *) PyNumber_Lshift(PyObject *o1, PyObject *o2);
791 PyAPI_FUNC(PyObject *) PyNumber_Rshift(PyObject *o1, PyObject *o2);
800 PyAPI_FUNC(PyObject *) PyNumber_And(PyObject *o1, PyObject *o2);
810 PyAPI_FUNC(PyObject *) PyNumber_Xor(PyObject *o1, PyObject *o2);
820 PyAPI_FUNC(PyObject *) PyNumber_Or(PyObject *o1, PyObject *o2);
848 #define PyIndex_Check(obj) \
849 ((obj)->ob_type->tp_as_number != NULL && \
850 PyType_HasFeature((obj)->ob_type, Py_TPFLAGS_HAVE_INDEX) && \
851 (obj)->ob_type->tp_as_number->nb_index != NULL)
853 PyAPI_FUNC(PyObject *) PyNumber_Index(PyObject *o);
871 PyAPI_FUNC(PyObject *) _PyNumber_ConvertIntegralToInt(
883 PyAPI_FUNC(PyObject *) PyNumber_Int(PyObject *o);
892 PyAPI_FUNC(PyObject *) PyNumber_Long(PyObject *o);
901 PyAPI_FUNC(PyObject *) PyNumber_Float(PyObject *o);
911 PyAPI_FUNC(PyObject *) PyNumber_InPlaceAdd(PyObject *o1, PyObject *o2);
920 PyAPI_FUNC(PyObject *) PyNumber_InPlaceSubtract(PyObject *o1, PyObject *o2);
929 PyAPI_FUNC(PyObject *) PyNumber_InPlaceMultiply(PyObject *o1, PyObject *o2);
938 PyAPI_FUNC(PyObject *) PyNumber_InPlaceDivide(PyObject *o1, PyObject *o2);
947 PyAPI_FUNC(PyObject *) PyNumber_InPlaceFloorDivide(PyObject *o1,
958 PyAPI_FUNC(PyObject *) PyNumber_InPlaceTrueDivide(PyObject *o1,
969 PyAPI_FUNC(PyObject *) PyNumber_InPlaceRemainder(PyObject *o1, PyObject *o2);
978 PyAPI_FUNC(PyObject *) PyNumber_InPlacePower(PyObject *o1, PyObject *o2,
988 PyAPI_FUNC(PyObject *) PyNumber_InPlaceLshift(PyObject *o1, PyObject *o2);
997 PyAPI_FUNC(PyObject *) PyNumber_InPlaceRshift(PyObject *o1, PyObject *o2);
1006 PyAPI_FUNC(PyObject *) PyNumber_InPlaceAnd(PyObject *o1, PyObject *o2);
1015 PyAPI_FUNC(PyObject *) PyNumber_InPlaceXor(PyObject *o1, PyObject *o2);
1024 PyAPI_FUNC(PyObject *) PyNumber_InPlaceOr(PyObject *o1, PyObject *o2);
1045 PyAPI_FUNC(
int) PySequence_Check(PyObject *o);
1055 PyAPI_FUNC(Py_ssize_t) PySequence_Size(PyObject *o);
1063 #undef PySequence_Length
1065 #define PySequence_Length PySequence_Size
1068 PyAPI_FUNC(PyObject *) PySequence_Concat(PyObject *o1, PyObject *o2);
1093 PyAPI_FUNC(PyObject *) PySequence_GetSlice(PyObject *o, Py_ssize_t
i1, Py_ssize_t
i2);
1102 PyAPI_FUNC(
int) PySequence_SetItem(PyObject *o, Py_ssize_t i, PyObject *v);
1111 PyAPI_FUNC(
int) PySequence_DelItem(PyObject *o, Py_ssize_t i);
1119 PyAPI_FUNC(
int) PySequence_SetSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2,
1128 PyAPI_FUNC(
int) PySequence_DelSlice(PyObject *o, Py_ssize_t i1, Py_ssize_t i2);
1136 PyAPI_FUNC(PyObject *) PySequence_Tuple(PyObject *o);
1144 PyAPI_FUNC(PyObject *) PySequence_List(PyObject *o);
1150 PyAPI_FUNC(PyObject *) PySequence_Fast(PyObject *o, const
char* m);
1160 #define PySequence_Fast_GET_SIZE(o) \
1161 (PyList_Check(o) ? PyList_GET_SIZE(o) : PyTuple_GET_SIZE(o))
1167 #define PySequence_Fast_GET_ITEM(o, i)\
1168 (PyList_Check(o) ? PyList_GET_ITEM(o, i) : PyTuple_GET_ITEM(o, i))
1174 #define PySequence_ITEM(o, i)\
1175 ( Py_TYPE(o)->tp_as_sequence->sq_item(o, i) )
1180 #define PySequence_Fast_ITEMS(sf) \
1181 (PyList_Check(sf) ? ((PyListObject *)(sf))->ob_item \
1182 : ((PyTupleObject *)(sf))->ob_item)
1201 #define PY_ITERSEARCH_COUNT 1
1202 #define PY_ITERSEARCH_INDEX 2
1203 #define PY_ITERSEARCH_CONTAINS 3
1204 PyAPI_FUNC(Py_ssize_t) _PySequence_IterSearch(PyObject *seq,
1218 #undef PySequence_In
1222 #define PySequence_In PySequence_Contains
1230 PyAPI_FUNC(Py_ssize_t) PySequence_Index(PyObject *o, PyObject *value);
1240 PyAPI_FUNC(PyObject *) PySequence_InPlaceConcat(PyObject *o1, PyObject *o2);
1249 PyAPI_FUNC(PyObject *) PySequence_InPlaceRepeat(PyObject *o, Py_ssize_t count);
1260 PyAPI_FUNC(
int) PyMapping_Check(PyObject *o);
1269 PyAPI_FUNC(Py_ssize_t) PyMapping_Size(PyObject *o);
1278 #undef PyMapping_Length
1280 #define PyMapping_Length PyMapping_Size
1291 #define PyMapping_DelItemString(O,K) PyObject_DelItemString((O),(K))
1301 #define PyMapping_DelItem(O,K) PyObject_DelItem((O),(K))
1303 PyAPI_FUNC(
int) PyMapping_HasKeyString(PyObject *o,
char *key);
1313 PyAPI_FUNC(
int) PyMapping_HasKey(PyObject *o, PyObject *key);
1332 #define PyMapping_Keys(O) PyObject_CallMethod(O,"keys",NULL)
1342 #define PyMapping_Values(O) PyObject_CallMethod(O,"values",NULL)
1354 #define PyMapping_Items(O) PyObject_CallMethod(O,"items",NULL)
1356 PyAPI_FUNC(PyObject *) PyMapping_GetItemString(PyObject *o,
char *key);
1364 PyAPI_FUNC(
int) PyMapping_SetItemString(PyObject *o,
char *key,
1377 PyAPI_FUNC(
int) PyObject_IsSubclass(PyObject *
object, PyObject *typeorclass);
1383 PyAPI_FUNC(
int) _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls);
1388 const Py_ssize_t *shape);
1389 PyAPI_FUNC(
void) _Py_add_one_to_index_C(
int nd, Py_ssize_t *index,
1390 const Py_ssize_t *shape);