python-2.7.6/include/sliceobject.h Source File

sliceobject.h
Go to the documentation of this file.
1 #ifndef Py_SLICEOBJECT_H
2 #define Py_SLICEOBJECT_H
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
6 
7 /* The unique ellipsis object "..." */
8 
9 PyAPI_DATA(PyObject) _Py_EllipsisObject; /* Don't use this directly */
10 
11 #define Py_Ellipsis (&_Py_EllipsisObject)
12 
13 /* Slice object interface */
14 
15 /*
16 
17 A slice object containing start, stop, and step data members (the
18 names are from range). After much talk with Guido, it was decided to
19 let these be any arbitrary python type. Py_None stands for omitted values.
20 */
21 
22 typedef struct {
24  PyObject *start, *stop, *step; /* not NULL */
26 
27 PyAPI_DATA(PyTypeObject) PySlice_Type;
28 PyAPI_DATA(PyTypeObject) PyEllipsis_Type;
29 
30 #define PySlice_Check(op) (Py_TYPE(op) == &PySlice_Type)
31 
33  PyObject* step);
34 PyAPI_FUNC(PyObject *) _PySlice_FromIndices(Py_ssize_t start, Py_ssize_t stop);
35 PyAPI_FUNC(int) PySlice_GetIndices(PySliceObject *r, Py_ssize_t length,
36  Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step);
37 PyAPI_FUNC(int) PySlice_GetIndicesEx(PySliceObject *r, Py_ssize_t length,
38  Py_ssize_t *start, Py_ssize_t *stop,
40 
41 #ifdef __cplusplus
42 }
43 #endif
44 #endif /* !Py_SLICEOBJECT_H */
Py_ssize_t length
Definition: sliceobject.h:35
Py_ssize_t Py_ssize_t Py_ssize_t Py_ssize_t Py_ssize_t * slicelength
Definition: sliceobject.h:37
PyAPI_DATA(PyObject) _Py_EllipsisObject
PyObject * stop
Definition: sliceobject.h:32
Py_intptr_t Py_ssize_t
Definition: pyport.h:185
PyObject PyObject * step
Definition: sliceobject.h:32
PyObject_HEAD PyObject * stop
Definition: sliceobject.h:24
Py_ssize_t Py_ssize_t * start
Definition: sliceobject.h:35
PyAPI_FUNC(PyObject *) PySlice_New(PyObject *start
#define PyObject_HEAD
Definition: object.h:78