1996-07-30 13:45:48 -03:00
|
|
|
/*
|
|
|
|
Written by Jim Hugunin and Chris Chase.
|
|
|
|
|
1996-10-11 13:25:41 -03:00
|
|
|
This includes both the singular ellipsis object and slice objects.
|
1996-07-30 13:45:48 -03:00
|
|
|
|
|
|
|
Guido, feel free to do whatever you want in the way of copyrights
|
|
|
|
for this file.
|
|
|
|
*/
|
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
/*
|
1996-10-11 13:25:41 -03:00
|
|
|
Py_Ellipsis encodes the '...' rubber index token. It is similar to
|
1996-07-30 13:45:48 -03:00
|
|
|
the Py_NoneStruct in that there is no way to create other objects of
|
|
|
|
this type and there is exactly one in existence.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "Python.h"
|
2001-08-02 01:15:00 -03:00
|
|
|
#include "structmember.h"
|
1996-07-30 13:45:48 -03:00
|
|
|
|
|
|
|
static PyObject *
|
2000-07-09 03:21:27 -03:00
|
|
|
ellipsis_repr(PyObject *op)
|
1996-07-30 13:45:48 -03:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
return PyString_FromString("Ellipsis");
|
1996-07-30 13:45:48 -03:00
|
|
|
}
|
|
|
|
|
2009-04-18 19:15:26 -03:00
|
|
|
PyTypeObject PyEllipsis_Type = {
|
2010-05-09 11:46:46 -03:00
|
|
|
PyVarObject_HEAD_INIT(&PyType_Type, 0)
|
|
|
|
"ellipsis", /* tp_name */
|
|
|
|
0, /* tp_basicsize */
|
|
|
|
0, /* tp_itemsize */
|
|
|
|
0, /*never called*/ /* tp_dealloc */
|
|
|
|
0, /* tp_print */
|
|
|
|
0, /* tp_getattr */
|
|
|
|
0, /* tp_setattr */
|
|
|
|
0, /* tp_compare */
|
|
|
|
ellipsis_repr, /* tp_repr */
|
|
|
|
0, /* tp_as_number */
|
|
|
|
0, /* tp_as_sequence */
|
|
|
|
0, /* tp_as_mapping */
|
|
|
|
0, /* tp_hash */
|
|
|
|
0, /* tp_call */
|
|
|
|
0, /* tp_str */
|
|
|
|
PyObject_GenericGetAttr, /* tp_getattro */
|
|
|
|
0, /* tp_setattro */
|
|
|
|
0, /* tp_as_buffer */
|
|
|
|
Py_TPFLAGS_DEFAULT, /* tp_flags */
|
1996-07-30 13:45:48 -03:00
|
|
|
};
|
|
|
|
|
1996-10-11 13:25:41 -03:00
|
|
|
PyObject _Py_EllipsisObject = {
|
2010-05-09 11:46:46 -03:00
|
|
|
_PyObject_EXTRA_INIT
|
|
|
|
1, &PyEllipsis_Type
|
1996-07-30 13:45:48 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* Slice object implementation
|
|
|
|
|
|
|
|
start, stop, and step are python objects with None indicating no
|
|
|
|
index is present.
|
|
|
|
*/
|
|
|
|
|
|
|
|
PyObject *
|
2000-07-09 03:21:27 -03:00
|
|
|
PySlice_New(PyObject *start, PyObject *stop, PyObject *step)
|
1996-07-30 13:45:48 -03:00
|
|
|
{
|
2016-04-16 18:47:12 -03:00
|
|
|
PySliceObject *obj = PyObject_GC_New(PySliceObject, &PySlice_Type);
|
1996-07-30 13:45:48 -03:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
if (obj == NULL)
|
|
|
|
return NULL;
|
2000-12-14 11:09:46 -04:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
if (step == NULL) step = Py_None;
|
|
|
|
Py_INCREF(step);
|
|
|
|
if (start == NULL) start = Py_None;
|
|
|
|
Py_INCREF(start);
|
|
|
|
if (stop == NULL) stop = Py_None;
|
|
|
|
Py_INCREF(stop);
|
1996-07-30 13:45:48 -03:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
obj->step = step;
|
|
|
|
obj->start = start;
|
|
|
|
obj->stop = stop;
|
1996-07-30 13:45:48 -03:00
|
|
|
|
2016-04-16 18:47:12 -03:00
|
|
|
_PyObject_GC_TRACK(obj);
|
2010-05-09 11:46:46 -03:00
|
|
|
return (PyObject *) obj;
|
1996-07-30 13:45:48 -03:00
|
|
|
}
|
|
|
|
|
2006-03-23 02:03:08 -04:00
|
|
|
PyObject *
|
|
|
|
_PySlice_FromIndices(Py_ssize_t istart, Py_ssize_t istop)
|
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
PyObject *start, *end, *slice;
|
|
|
|
start = PyInt_FromSsize_t(istart);
|
|
|
|
if (!start)
|
|
|
|
return NULL;
|
|
|
|
end = PyInt_FromSsize_t(istop);
|
|
|
|
if (!end) {
|
|
|
|
Py_DECREF(start);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
slice = PySlice_New(start, end, NULL);
|
|
|
|
Py_DECREF(start);
|
|
|
|
Py_DECREF(end);
|
|
|
|
return slice;
|
2006-03-23 02:03:08 -04:00
|
|
|
}
|
|
|
|
|
1996-07-30 13:45:48 -03:00
|
|
|
int
|
2006-02-15 13:27:45 -04:00
|
|
|
PySlice_GetIndices(PySliceObject *r, Py_ssize_t length,
|
|
|
|
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step)
|
1996-07-30 13:45:48 -03:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
/* XXX support long ints */
|
|
|
|
if (r->step == Py_None) {
|
|
|
|
*step = 1;
|
|
|
|
} else {
|
2018-07-31 03:09:36 -03:00
|
|
|
if (!_PyAnyInt_Check(r->step)) return -1;
|
2010-05-09 11:46:46 -03:00
|
|
|
*step = PyInt_AsSsize_t(r->step);
|
|
|
|
}
|
|
|
|
if (r->start == Py_None) {
|
|
|
|
*start = *step < 0 ? length-1 : 0;
|
|
|
|
} else {
|
2018-07-31 03:09:36 -03:00
|
|
|
if (!_PyAnyInt_Check(r->start)) return -1;
|
2010-05-09 11:46:46 -03:00
|
|
|
*start = PyInt_AsSsize_t(r->start);
|
|
|
|
if (*start < 0) *start += length;
|
|
|
|
}
|
|
|
|
if (r->stop == Py_None) {
|
|
|
|
*stop = *step < 0 ? -1 : length;
|
|
|
|
} else {
|
2018-07-31 03:09:36 -03:00
|
|
|
if (!_PyAnyInt_Check(r->stop)) return -1;
|
2010-05-09 11:46:46 -03:00
|
|
|
*stop = PyInt_AsSsize_t(r->stop);
|
|
|
|
if (*stop < 0) *stop += length;
|
|
|
|
}
|
|
|
|
if (*stop > length) return -1;
|
|
|
|
if (*start >= length) return -1;
|
|
|
|
if (*step == 0) return -1;
|
|
|
|
return 0;
|
1996-07-30 13:45:48 -03:00
|
|
|
}
|
|
|
|
|
2002-06-11 07:55:12 -03:00
|
|
|
int
|
2017-01-25 07:22:06 -04:00
|
|
|
_PySlice_Unpack(PyObject *_r,
|
|
|
|
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step)
|
2002-06-11 07:55:12 -03:00
|
|
|
{
|
2017-01-25 07:22:06 -04:00
|
|
|
PySliceObject *r = (PySliceObject *)_r;
|
2010-05-09 11:46:46 -03:00
|
|
|
/* this is harder to get right than you might think */
|
|
|
|
|
2017-05-10 08:20:28 -03:00
|
|
|
assert(PY_SSIZE_T_MIN + 1 <= -PY_SSIZE_T_MAX);
|
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
if (r->step == Py_None) {
|
|
|
|
*step = 1;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (!_PyEval_SliceIndex(r->step, step)) return -1;
|
|
|
|
if (*step == 0) {
|
|
|
|
PyErr_SetString(PyExc_ValueError,
|
|
|
|
"slice step cannot be zero");
|
|
|
|
return -1;
|
|
|
|
}
|
2017-05-03 11:00:12 -03:00
|
|
|
/* Here *step might be -PY_SSIZE_T_MAX-1; in this case we replace it
|
|
|
|
* with -PY_SSIZE_T_MAX. This doesn't affect the semantics, and it
|
|
|
|
* guards against later undefined behaviour resulting from code that
|
|
|
|
* does "step = -step" as part of a slice reversal.
|
|
|
|
*/
|
|
|
|
if (*step < -PY_SSIZE_T_MAX)
|
|
|
|
*step = -PY_SSIZE_T_MAX;
|
2010-05-09 11:46:46 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (r->start == Py_None) {
|
2017-05-10 08:20:28 -03:00
|
|
|
*start = *step < 0 ? PY_SSIZE_T_MAX : 0;
|
2010-05-09 11:46:46 -03:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (!_PyEval_SliceIndex(r->start, start)) return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (r->stop == Py_None) {
|
2017-05-10 08:20:28 -03:00
|
|
|
*stop = *step < 0 ? PY_SSIZE_T_MIN : PY_SSIZE_T_MAX;
|
2010-05-09 11:46:46 -03:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (!_PyEval_SliceIndex(r->stop, stop)) return -1;
|
|
|
|
}
|
|
|
|
|
2017-01-25 07:22:06 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
Py_ssize_t
|
|
|
|
_PySlice_AdjustIndices(Py_ssize_t length,
|
|
|
|
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t step)
|
|
|
|
{
|
|
|
|
/* this is harder to get right than you might think */
|
|
|
|
|
|
|
|
assert(step != 0);
|
|
|
|
assert(step >= -PY_SSIZE_T_MAX);
|
|
|
|
|
|
|
|
if (*start < 0) {
|
|
|
|
*start += length;
|
|
|
|
if (*start < 0) {
|
|
|
|
*start = (step < 0) ? -1 : 0;
|
|
|
|
}
|
2010-05-09 11:46:46 -03:00
|
|
|
}
|
2017-01-25 07:22:06 -04:00
|
|
|
else if (*start >= length) {
|
|
|
|
*start = (step < 0) ? length - 1 : length;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (*stop < 0) {
|
|
|
|
*stop += length;
|
|
|
|
if (*stop < 0) {
|
|
|
|
*stop = (step < 0) ? -1 : 0;
|
|
|
|
}
|
|
|
|
}
|
2017-05-10 08:20:28 -03:00
|
|
|
else if (*stop >= length) {
|
2017-01-25 07:22:06 -04:00
|
|
|
*stop = (step < 0) ? length - 1 : length;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (step < 0) {
|
|
|
|
if (*stop < *start) {
|
|
|
|
return (*start - *stop - 1) / (-step) + 1;
|
|
|
|
}
|
2010-05-09 11:46:46 -03:00
|
|
|
}
|
|
|
|
else {
|
2017-01-25 07:22:06 -04:00
|
|
|
if (*start < *stop) {
|
|
|
|
return (*stop - *start - 1) / step + 1;
|
|
|
|
}
|
2010-05-09 11:46:46 -03:00
|
|
|
}
|
2017-01-25 07:22:06 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef PySlice_GetIndicesEx
|
2010-05-09 11:46:46 -03:00
|
|
|
|
2017-01-25 07:22:06 -04:00
|
|
|
int
|
|
|
|
PySlice_GetIndicesEx(PySliceObject *r, Py_ssize_t length,
|
|
|
|
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step,
|
|
|
|
Py_ssize_t *slicelength)
|
|
|
|
{
|
|
|
|
if (_PySlice_Unpack((PyObject *)r, start, stop, step) < 0)
|
|
|
|
return -1;
|
|
|
|
*slicelength = _PySlice_AdjustIndices(length, start, stop, *step);
|
2010-05-09 11:46:46 -03:00
|
|
|
return 0;
|
2002-06-11 07:55:12 -03:00
|
|
|
}
|
|
|
|
|
2002-06-14 17:41:17 -03:00
|
|
|
static PyObject *
|
|
|
|
slice_new(PyTypeObject *type, PyObject *args, PyObject *kw)
|
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
PyObject *start, *stop, *step;
|
2002-06-14 17:41:17 -03:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
start = stop = step = NULL;
|
2002-06-14 17:41:17 -03:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
if (!_PyArg_NoKeywords("slice()", kw))
|
|
|
|
return NULL;
|
2005-08-26 03:42:30 -03:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
if (!PyArg_UnpackTuple(args, "slice", 1, 3, &start, &stop, &step))
|
|
|
|
return NULL;
|
2002-06-14 17:41:17 -03:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
/* This swapping of stop and start is to maintain similarity with
|
|
|
|
range(). */
|
|
|
|
if (stop == NULL) {
|
|
|
|
stop = start;
|
|
|
|
start = NULL;
|
|
|
|
}
|
|
|
|
return PySlice_New(start, stop, step);
|
2002-06-14 17:41:17 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
PyDoc_STRVAR(slice_doc,
|
2012-10-08 00:37:54 -03:00
|
|
|
"slice(stop)\n\
|
|
|
|
slice(start, stop[, step])\n\
|
2002-06-14 17:41:17 -03:00
|
|
|
\n\
|
|
|
|
Create a slice object. This is used for extended slicing (e.g. a[0:10:2]).");
|
|
|
|
|
1996-07-30 13:45:48 -03:00
|
|
|
static void
|
2000-07-09 03:21:27 -03:00
|
|
|
slice_dealloc(PySliceObject *r)
|
1996-07-30 13:45:48 -03:00
|
|
|
{
|
2016-04-16 18:47:12 -03:00
|
|
|
_PyObject_GC_UNTRACK(r);
|
2010-05-09 11:46:46 -03:00
|
|
|
Py_DECREF(r->step);
|
|
|
|
Py_DECREF(r->start);
|
|
|
|
Py_DECREF(r->stop);
|
2016-04-16 18:47:12 -03:00
|
|
|
PyObject_GC_Del(r);
|
1996-07-30 13:45:48 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *
|
2000-07-09 03:21:27 -03:00
|
|
|
slice_repr(PySliceObject *r)
|
1996-07-30 13:45:48 -03:00
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
PyObject *s, *comma;
|
|
|
|
|
|
|
|
s = PyString_FromString("slice(");
|
|
|
|
comma = PyString_FromString(", ");
|
|
|
|
PyString_ConcatAndDel(&s, PyObject_Repr(r->start));
|
|
|
|
PyString_Concat(&s, comma);
|
|
|
|
PyString_ConcatAndDel(&s, PyObject_Repr(r->stop));
|
|
|
|
PyString_Concat(&s, comma);
|
|
|
|
PyString_ConcatAndDel(&s, PyObject_Repr(r->step));
|
|
|
|
PyString_ConcatAndDel(&s, PyString_FromString(")"));
|
|
|
|
Py_DECREF(comma);
|
|
|
|
return s;
|
1996-07-30 13:45:48 -03:00
|
|
|
}
|
|
|
|
|
2001-09-20 17:46:19 -03:00
|
|
|
static PyMemberDef slice_members[] = {
|
2010-05-09 11:46:46 -03:00
|
|
|
{"start", T_OBJECT, offsetof(PySliceObject, start), READONLY},
|
|
|
|
{"stop", T_OBJECT, offsetof(PySliceObject, stop), READONLY},
|
|
|
|
{"step", T_OBJECT, offsetof(PySliceObject, step), READONLY},
|
|
|
|
{0}
|
2001-08-02 01:15:00 -03:00
|
|
|
};
|
1996-07-30 13:45:48 -03:00
|
|
|
|
2002-07-19 12:47:06 -03:00
|
|
|
static PyObject*
|
|
|
|
slice_indices(PySliceObject* self, PyObject* len)
|
|
|
|
{
|
2017-04-15 14:11:12 -03:00
|
|
|
Py_ssize_t ilen, start, stop, step;
|
2002-07-19 12:47:06 -03:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
ilen = PyNumber_AsSsize_t(len, PyExc_OverflowError);
|
2002-07-19 12:47:06 -03:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
if (ilen == -1 && PyErr_Occurred()) {
|
|
|
|
return NULL;
|
|
|
|
}
|
2002-07-19 12:47:06 -03:00
|
|
|
|
2017-04-15 14:11:12 -03:00
|
|
|
if (_PySlice_Unpack((PyObject *)self, &start, &stop, &step) < 0) {
|
2010-05-09 11:46:46 -03:00
|
|
|
return NULL;
|
|
|
|
}
|
2017-04-15 14:11:12 -03:00
|
|
|
_PySlice_AdjustIndices(ilen, &start, &stop, step);
|
2002-07-19 12:47:06 -03:00
|
|
|
|
2010-05-09 11:46:46 -03:00
|
|
|
return Py_BuildValue("(nnn)", start, stop, step);
|
2002-07-19 12:47:06 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
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.");
|
|
|
|
|
2007-04-11 15:40:58 -03:00
|
|
|
static PyObject *
|
|
|
|
slice_reduce(PySliceObject* self)
|
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
return Py_BuildValue("O(OOO)", Py_TYPE(self), self->start, self->stop, self->step);
|
2007-04-11 15:40:58 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
PyDoc_STRVAR(reduce_doc, "Return state information for pickling.");
|
|
|
|
|
2002-07-19 12:47:06 -03:00
|
|
|
static PyMethodDef slice_methods[] = {
|
2010-05-09 11:46:46 -03:00
|
|
|
{"indices", (PyCFunction)slice_indices,
|
|
|
|
METH_O, slice_indices_doc},
|
|
|
|
{"__reduce__", (PyCFunction)slice_reduce,
|
|
|
|
METH_NOARGS, reduce_doc},
|
|
|
|
{NULL, NULL}
|
2002-07-19 12:47:06 -03:00
|
|
|
};
|
|
|
|
|
2001-03-20 08:41:34 -04:00
|
|
|
static int
|
|
|
|
slice_compare(PySliceObject *v, PySliceObject *w)
|
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
int result = 0;
|
|
|
|
|
|
|
|
if (v == w)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
if (PyObject_Cmp(v->start, w->start, &result) < 0)
|
|
|
|
return -2;
|
|
|
|
if (result != 0)
|
|
|
|
return result;
|
|
|
|
if (PyObject_Cmp(v->stop, w->stop, &result) < 0)
|
|
|
|
return -2;
|
|
|
|
if (result != 0)
|
|
|
|
return result;
|
|
|
|
if (PyObject_Cmp(v->step, w->step, &result) < 0)
|
|
|
|
return -2;
|
|
|
|
return result;
|
2001-03-20 08:41:34 -04:00
|
|
|
}
|
1996-07-30 13:45:48 -03:00
|
|
|
|
2003-09-05 11:27:30 -03:00
|
|
|
static long
|
|
|
|
slice_hash(PySliceObject *v)
|
|
|
|
{
|
2010-05-09 11:46:46 -03:00
|
|
|
PyErr_SetString(PyExc_TypeError, "unhashable type");
|
|
|
|
return -1L;
|
2003-09-05 11:27:30 -03:00
|
|
|
}
|
|
|
|
|
2016-04-16 18:47:12 -03:00
|
|
|
static int
|
|
|
|
slice_traverse(PySliceObject *v, visitproc visit, void *arg)
|
|
|
|
{
|
|
|
|
Py_VISIT(v->start);
|
|
|
|
Py_VISIT(v->stop);
|
|
|
|
Py_VISIT(v->step);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1996-07-30 13:45:48 -03:00
|
|
|
PyTypeObject PySlice_Type = {
|
2010-05-09 11:46:46 -03:00
|
|
|
PyVarObject_HEAD_INIT(&PyType_Type, 0)
|
|
|
|
"slice", /* Name of this type */
|
|
|
|
sizeof(PySliceObject), /* Basic object size */
|
|
|
|
0, /* Item size for varobject */
|
|
|
|
(destructor)slice_dealloc, /* tp_dealloc */
|
|
|
|
0, /* tp_print */
|
|
|
|
0, /* tp_getattr */
|
|
|
|
0, /* tp_setattr */
|
|
|
|
(cmpfunc)slice_compare, /* tp_compare */
|
|
|
|
(reprfunc)slice_repr, /* tp_repr */
|
|
|
|
0, /* tp_as_number */
|
|
|
|
0, /* tp_as_sequence */
|
|
|
|
0, /* tp_as_mapping */
|
|
|
|
(hashfunc)slice_hash, /* tp_hash */
|
|
|
|
0, /* tp_call */
|
|
|
|
0, /* tp_str */
|
|
|
|
PyObject_GenericGetAttr, /* tp_getattro */
|
|
|
|
0, /* tp_setattro */
|
|
|
|
0, /* tp_as_buffer */
|
2016-04-16 18:47:12 -03:00
|
|
|
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */
|
2010-05-09 11:46:46 -03:00
|
|
|
slice_doc, /* tp_doc */
|
2016-04-16 18:47:12 -03:00
|
|
|
(traverseproc)slice_traverse, /* tp_traverse */
|
2010-05-09 11:46:46 -03:00
|
|
|
0, /* tp_clear */
|
|
|
|
0, /* tp_richcompare */
|
|
|
|
0, /* tp_weaklistoffset */
|
|
|
|
0, /* tp_iter */
|
|
|
|
0, /* tp_iternext */
|
|
|
|
slice_methods, /* tp_methods */
|
|
|
|
slice_members, /* tp_members */
|
|
|
|
0, /* tp_getset */
|
|
|
|
0, /* tp_base */
|
|
|
|
0, /* tp_dict */
|
|
|
|
0, /* tp_descr_get */
|
|
|
|
0, /* tp_descr_set */
|
|
|
|
0, /* tp_dictoffset */
|
|
|
|
0, /* tp_init */
|
|
|
|
0, /* tp_alloc */
|
|
|
|
slice_new, /* tp_new */
|
1996-07-30 13:45:48 -03:00
|
|
|
};
|