#include "Python.h"
#include "pycore_abstract.h"
#include "pycore_pybuffer.h"
#include "pycore_call.h"
#include "pycore_ceval.h"
#include "pycore_crossinterp.h"
#include "pycore_object.h"
#include "pycore_long.h"
#include "pycore_pyerrors.h"
#include "pycore_pystate.h"
#include "pycore_unionobject.h"
#include <stddef.h>
static PyObject *
type_error(const char *msg, PyObject *obj)
{ … }
static PyObject *
null_error(void)
{ … }
PyObject *
PyObject_Type(PyObject *o)
{ … }
Py_ssize_t
PyObject_Size(PyObject *o)
{ … }
#undef PyObject_Length
Py_ssize_t
PyObject_Length(PyObject *o)
{ … }
#define PyObject_Length …
int
_PyObject_HasLen(PyObject *o) { … }
Py_ssize_t
PyObject_LengthHint(PyObject *o, Py_ssize_t defaultvalue)
{ … }
PyObject *
PyObject_GetItem(PyObject *o, PyObject *key)
{ … }
int
PyMapping_GetOptionalItem(PyObject *obj, PyObject *key, PyObject **result)
{ … }
int
PyObject_SetItem(PyObject *o, PyObject *key, PyObject *value)
{ … }
int
PyObject_DelItem(PyObject *o, PyObject *key)
{ … }
int
PyObject_DelItemString(PyObject *o, const char *key)
{ … }
int
PyObject_CheckBuffer(PyObject *obj)
{ … }
PyAPI_FUNC(int)
PyObject_CheckReadBuffer(PyObject *obj)
{ … }
static int
as_read_buffer(PyObject *obj, const void **buffer, Py_ssize_t *buffer_len)
{ … }
PyAPI_FUNC(int)
PyObject_AsCharBuffer(PyObject *obj,
const char **buffer,
Py_ssize_t *buffer_len)
{ … }
PyAPI_FUNC(int)
PyObject_AsReadBuffer(PyObject *obj,
const void **buffer,
Py_ssize_t *buffer_len)
{ … }
PyAPI_FUNC(int)
PyObject_AsWriteBuffer(PyObject *obj,
void **buffer,
Py_ssize_t *buffer_len)
{ … }
int
PyObject_GetBuffer(PyObject *obj, Py_buffer *view, int flags)
{ … }
static int
_IsFortranContiguous(const Py_buffer *view)
{ … }
static int
_IsCContiguous(const Py_buffer *view)
{ … }
int
PyBuffer_IsContiguous(const Py_buffer *view, char order)
{ … }
void*
PyBuffer_GetPointer(const Py_buffer *view, const Py_ssize_t *indices)
{ … }
static void
_Py_add_one_to_index_F(int nd, Py_ssize_t *index, const Py_ssize_t *shape)
{ … }
static void
_Py_add_one_to_index_C(int nd, Py_ssize_t *index, const Py_ssize_t *shape)
{ … }
Py_ssize_t
PyBuffer_SizeFromFormat(const char *format)
{ … }
int
PyBuffer_FromContiguous(const Py_buffer *view, const void *buf, Py_ssize_t len, char fort)
{ … }
int PyObject_CopyData(PyObject *dest, PyObject *src)
{ … }
void
PyBuffer_FillContiguousStrides(int nd, Py_ssize_t *shape,
Py_ssize_t *strides, int itemsize,
char fort)
{ … }
int
PyBuffer_FillInfo(Py_buffer *view, PyObject *obj, void *buf, Py_ssize_t len,
int readonly, int flags)
{ … }
void
PyBuffer_Release(Py_buffer *view)
{ … }
static int
_buffer_release_call(void *arg)
{ … }
int
_PyBuffer_ReleaseInInterpreter(PyInterpreterState *interp,
Py_buffer *view)
{ … }
int
_PyBuffer_ReleaseInInterpreterAndRawFree(PyInterpreterState *interp,
Py_buffer *view)
{ … }
PyObject *
PyObject_Format(PyObject *obj, PyObject *format_spec)
{ … }
int
PyNumber_Check(PyObject *o)
{ … }
#define NB_SLOT(x) …
#define NB_BINOP(nb_methods, slot) …
#define NB_TERNOP(nb_methods, slot) …
static PyObject *
binary_op1(PyObject *v, PyObject *w, const int op_slot
#ifndef NDEBUG
, const char *op_name
#endif
)
{ … }
#ifdef NDEBUG
#define BINARY_OP1(v, w, op_slot, op_name) …
#else
#define BINARY_OP1 …
#endif
static PyObject *
binop_type_error(PyObject *v, PyObject *w, const char *op_name)
{ … }
static PyObject *
binary_op(PyObject *v, PyObject *w, const int op_slot, const char *op_name)
{ … }
static PyObject *
ternary_op(PyObject *v,
PyObject *w,
PyObject *z,
const int op_slot,
const char *op_name
)
{ … }
#define BINARY_FUNC(func, op, op_name) …
BINARY_FUNC(PyNumber_Or, nb_or, "|")
BINARY_FUNC(PyNumber_Xor, nb_xor, "^")
BINARY_FUNC(PyNumber_And, nb_and, "&")
BINARY_FUNC(PyNumber_Lshift, nb_lshift, "<<")
BINARY_FUNC(PyNumber_Rshift, nb_rshift, ">>")
BINARY_FUNC(PyNumber_Subtract, nb_subtract, "-")
BINARY_FUNC(PyNumber_Divmod, nb_divmod, "divmod()")
PyObject *
PyNumber_Add(PyObject *v, PyObject *w)
{ … }
static PyObject *
sequence_repeat(ssizeargfunc repeatfunc, PyObject *seq, PyObject *n)
{ … }
PyObject *
PyNumber_Multiply(PyObject *v, PyObject *w)
{ … }
BINARY_FUNC(PyNumber_MatrixMultiply, nb_matrix_multiply, "@")
BINARY_FUNC(PyNumber_FloorDivide, nb_floor_divide, "//")
BINARY_FUNC(PyNumber_TrueDivide, nb_true_divide, "/")
BINARY_FUNC(PyNumber_Remainder, nb_remainder, "%")
PyObject *
PyNumber_Power(PyObject *v, PyObject *w, PyObject *z)
{ … }
PyObject *
_PyNumber_PowerNoMod(PyObject *lhs, PyObject *rhs)
{ … }
static PyObject *
binary_iop1(PyObject *v, PyObject *w, const int iop_slot, const int op_slot
#ifndef NDEBUG
, const char *op_name
#endif
)
{ … }
#ifdef NDEBUG
#define BINARY_IOP1(v, w, iop_slot, op_slot, op_name) …
#else
#define BINARY_IOP1 …
#endif
static PyObject *
binary_iop(PyObject *v, PyObject *w, const int iop_slot, const int op_slot,
const char *op_name)
{ … }
static PyObject *
ternary_iop(PyObject *v, PyObject *w, PyObject *z, const int iop_slot, const int op_slot,
const char *op_name)
{ … }
#define INPLACE_BINOP(func, iop, op, op_name) …
INPLACE_BINOP(PyNumber_InPlaceOr, nb_inplace_or, nb_or, "|=")
INPLACE_BINOP(PyNumber_InPlaceXor, nb_inplace_xor, nb_xor, "^=")
INPLACE_BINOP(PyNumber_InPlaceAnd, nb_inplace_and, nb_and, "&=")
INPLACE_BINOP(PyNumber_InPlaceLshift, nb_inplace_lshift, nb_lshift, "<<=")
INPLACE_BINOP(PyNumber_InPlaceRshift, nb_inplace_rshift, nb_rshift, ">>=")
INPLACE_BINOP(PyNumber_InPlaceSubtract, nb_inplace_subtract, nb_subtract, "-=")
INPLACE_BINOP(PyNumber_InPlaceMatrixMultiply, nb_inplace_matrix_multiply, nb_matrix_multiply, "@=")
INPLACE_BINOP(PyNumber_InPlaceFloorDivide, nb_inplace_floor_divide, nb_floor_divide, "//=")
INPLACE_BINOP(PyNumber_InPlaceTrueDivide, nb_inplace_true_divide, nb_true_divide, "/=")
INPLACE_BINOP(PyNumber_InPlaceRemainder, nb_inplace_remainder, nb_remainder, "%=")
PyObject *
PyNumber_InPlaceAdd(PyObject *v, PyObject *w)
{ … }
PyObject *
PyNumber_InPlaceMultiply(PyObject *v, PyObject *w)
{ … }
PyObject *
PyNumber_InPlacePower(PyObject *v, PyObject *w, PyObject *z)
{ … }
PyObject *
_PyNumber_InPlacePowerNoMod(PyObject *lhs, PyObject *rhs)
{ … }
#define UNARY_FUNC(func, op, meth_name, descr) …
UNARY_FUNC(…)
UNARY_FUNC(…)
UNARY_FUNC(…)
UNARY_FUNC(…)
int
PyIndex_Check(PyObject *obj)
{ … }
PyObject *
_PyNumber_Index(PyObject *item)
{ … }
PyObject *
PyNumber_Index(PyObject *item)
{ … }
Py_ssize_t
PyNumber_AsSsize_t(PyObject *item, PyObject *err)
{ … }
PyObject *
PyNumber_Long(PyObject *o)
{ … }
PyObject *
PyNumber_Float(PyObject *o)
{ … }
PyObject *
PyNumber_ToBase(PyObject *n, int base)
{ … }
int
PySequence_Check(PyObject *s)
{ … }
Py_ssize_t
PySequence_Size(PyObject *s)
{ … }
#undef PySequence_Length
Py_ssize_t
PySequence_Length(PyObject *s)
{ … }
#define PySequence_Length …
PyObject *
PySequence_Concat(PyObject *s, PyObject *o)
{ … }
PyObject *
PySequence_Repeat(PyObject *o, Py_ssize_t count)
{ … }
PyObject *
PySequence_InPlaceConcat(PyObject *s, PyObject *o)
{ … }
PyObject *
PySequence_InPlaceRepeat(PyObject *o, Py_ssize_t count)
{ … }
PyObject *
PySequence_GetItem(PyObject *s, Py_ssize_t i)
{ … }
PyObject *
PySequence_GetSlice(PyObject *s, Py_ssize_t i1, Py_ssize_t i2)
{ … }
int
PySequence_SetItem(PyObject *s, Py_ssize_t i, PyObject *o)
{ … }
int
PySequence_DelItem(PyObject *s, Py_ssize_t i)
{ … }
int
PySequence_SetSlice(PyObject *s, Py_ssize_t i1, Py_ssize_t i2, PyObject *o)
{ … }
int
PySequence_DelSlice(PyObject *s, Py_ssize_t i1, Py_ssize_t i2)
{ … }
PyObject *
PySequence_Tuple(PyObject *v)
{ … }
PyObject *
PySequence_List(PyObject *v)
{ … }
PyObject *
PySequence_Fast(PyObject *v, const char *m)
{ … }
Py_ssize_t
_PySequence_IterSearch(PyObject *seq, PyObject *obj, int operation)
{ … }
Py_ssize_t
PySequence_Count(PyObject *s, PyObject *o)
{ … }
int
PySequence_Contains(PyObject *seq, PyObject *ob)
{ … }
#undef PySequence_In
int
PySequence_In(PyObject *w, PyObject *v)
{ … }
Py_ssize_t
PySequence_Index(PyObject *s, PyObject *o)
{ … }
int
PyMapping_Check(PyObject *o)
{ … }
Py_ssize_t
PyMapping_Size(PyObject *o)
{ … }
#undef PyMapping_Length
Py_ssize_t
PyMapping_Length(PyObject *o)
{ … }
#define PyMapping_Length …
PyObject *
PyMapping_GetItemString(PyObject *o, const char *key)
{ … }
int
PyMapping_GetOptionalItemString(PyObject *obj, const char *key, PyObject **result)
{ … }
int
PyMapping_SetItemString(PyObject *o, const char *key, PyObject *value)
{ … }
int
PyMapping_HasKeyStringWithError(PyObject *obj, const char *key)
{ … }
int
PyMapping_HasKeyWithError(PyObject *obj, PyObject *key)
{ … }
int
PyMapping_HasKeyString(PyObject *obj, const char *key)
{ … }
int
PyMapping_HasKey(PyObject *obj, PyObject *key)
{ … }
static PyObject *
method_output_as_list(PyObject *o, PyObject *meth)
{ … }
PyObject *
PyMapping_Keys(PyObject *o)
{ … }
PyObject *
PyMapping_Items(PyObject *o)
{ … }
PyObject *
PyMapping_Values(PyObject *o)
{ … }
static PyObject *
abstract_get_bases(PyObject *cls)
{ … }
static int
abstract_issubclass(PyObject *derived, PyObject *cls)
{ … }
static int
check_class(PyObject *cls, const char *error)
{ … }
static int
object_isinstance(PyObject *inst, PyObject *cls)
{ … }
static int
object_recursive_isinstance(PyThreadState *tstate, PyObject *inst, PyObject *cls)
{ … }
int
PyObject_IsInstance(PyObject *inst, PyObject *cls)
{ … }
static int
recursive_issubclass(PyObject *derived, PyObject *cls)
{ … }
static int
object_issubclass(PyThreadState *tstate, PyObject *derived, PyObject *cls)
{ … }
int
PyObject_IsSubclass(PyObject *derived, PyObject *cls)
{ … }
int
_PyObject_RealIsInstance(PyObject *inst, PyObject *cls)
{ … }
int
_PyObject_RealIsSubclass(PyObject *derived, PyObject *cls)
{ … }
PyObject *
PyObject_GetIter(PyObject *o)
{ … }
PyObject *
PyObject_GetAIter(PyObject *o) { … }
int
PyIter_Check(PyObject *obj)
{ … }
int
PyAIter_Check(PyObject *obj)
{ … }
static int
iternext(PyObject *iter, PyObject **item)
{ … }
int
PyIter_NextItem(PyObject *iter, PyObject **item)
{ … }
PyObject *
PyIter_Next(PyObject *iter)
{ … }
PySendResult
PyIter_Send(PyObject *iter, PyObject *arg, PyObject **result)
{ … }