#include "Python.h"
#include "pycore_abstract.h"
#include "pycore_freelist.h"
#include "pycore_long.h"
#include "pycore_modsupport.h"
#include "pycore_object.h"
static PyObject *
ellipsis_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{ … }
static void
ellipsis_dealloc(PyObject *ellipsis)
{ … }
static PyObject *
ellipsis_repr(PyObject *op)
{ … }
static PyObject *
ellipsis_reduce(PyObject *op, PyObject *Py_UNUSED(ignored))
{ … }
static PyMethodDef ellipsis_methods[] = …;
PyDoc_STRVAR(ellipsis_doc,
"ellipsis()\n"
"--\n\n"
"The type of the Ellipsis singleton.");
PyTypeObject PyEllipsis_Type = …;
PyObject _Py_EllipsisObject = …;
static PySliceObject *
_PyBuildSlice_Consume2(PyObject *start, PyObject *stop, PyObject *step)
{ … }
PyObject *
PySlice_New(PyObject *start, PyObject *stop, PyObject *step)
{ … }
PyObject *
_PyBuildSlice_ConsumeRefs(PyObject *start, PyObject *stop)
{ … }
PyObject *
_PySlice_FromIndices(Py_ssize_t istart, Py_ssize_t istop)
{ … }
int
PySlice_GetIndices(PyObject *_r, Py_ssize_t length,
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step)
{ … }
int
PySlice_Unpack(PyObject *_r,
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step)
{ … }
Py_ssize_t
PySlice_AdjustIndices(Py_ssize_t length,
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t step)
{ … }
#undef PySlice_GetIndicesEx
int
PySlice_GetIndicesEx(PyObject *_r, Py_ssize_t length,
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step,
Py_ssize_t *slicelength)
{ … }
static PyObject *
slice_new(PyTypeObject *type, PyObject *args, PyObject *kw)
{ … }
PyDoc_STRVAR(slice_doc,
"slice(stop)\n\
slice(start, stop[, step])\n\
\n\
Create a slice object. This is used for extended slicing (e.g. a[0:10:2]).");
static void
slice_dealloc(PySliceObject *r)
{ … }
static PyObject *
slice_repr(PySliceObject *r)
{ … }
static PyMemberDef slice_members[] = …;
static PyObject*
evaluate_slice_index(PyObject *v)
{ … }
int
_PySlice_GetLongIndices(PySliceObject *self, PyObject *length,
PyObject **start_ptr, PyObject **stop_ptr,
PyObject **step_ptr)
{ … }
static PyObject*
slice_indices(PySliceObject* self, PyObject* len)
{ … }
PyDoc_STRVAR(slice_indices_doc,
"S.indices(len) -> (start, stop, stride)\n\
\n\
Assuming a sequence of length len, calculate the start and stop\n\
indices, and the stride length of the extended slice described by\n\
S. Out of bounds indices are clipped in a manner consistent with the\n\
handling of normal slices.");
static PyObject *
slice_reduce(PySliceObject* self, PyObject *Py_UNUSED(ignored))
{ … }
PyDoc_STRVAR(reduce_doc, "Return state information for pickling.");
static PyMethodDef slice_methods[] = …;
static PyObject *
slice_richcompare(PyObject *v, PyObject *w, int op)
{ … }
static int
slice_traverse(PySliceObject *v, visitproc visit, void *arg)
{ … }
#if SIZEOF_PY_UHASH_T > 4
#define _PyHASH_XXPRIME_1 …
#define _PyHASH_XXPRIME_2 …
#define _PyHASH_XXPRIME_5 …
#define _PyHASH_XXROTATE(x) …
#else
#define _PyHASH_XXPRIME_1 …
#define _PyHASH_XXPRIME_2 …
#define _PyHASH_XXPRIME_5 …
#define _PyHASH_XXROTATE …
#endif
static Py_hash_t
slicehash(PySliceObject *v)
{ … }
PyTypeObject PySlice_Type = …;