summaryrefslogtreecommitdiff
path: root/Objects/sliceobject.c
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2011-07-30 10:57:28 +0800
committerSenthil Kumaran <senthil@uthcode.com>2011-07-30 10:57:28 +0800
commit193cd2fb262ed1896f630f03e179a850db8a1001 (patch)
tree84381f9d58b857a35701542e4387d07d54c9b1ab /Objects/sliceobject.c
parent3d23fd649309fe80fdd1dee04b668fefb50c1b97 (diff)
parent18d7d7a2176e169942d5764516eee6f952610884 (diff)
downloadcpython-git-193cd2fb262ed1896f630f03e179a850db8a1001.tar.gz
merge heads.
Diffstat (limited to 'Objects/sliceobject.c')
-rw-r--r--Objects/sliceobject.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c
index 51c53a8a11..53cc951a73 100644
--- a/Objects/sliceobject.c
+++ b/Objects/sliceobject.c
@@ -17,6 +17,17 @@ this type and there is exactly one in existence.
#include "structmember.h"
static PyObject *
+ellipsis_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
+{
+ if (PyTuple_GET_SIZE(args) || (kwargs && PyDict_Size(kwargs))) {
+ PyErr_SetString(PyExc_TypeError, "EllipsisType takes no arguments");
+ return NULL;
+ }
+ Py_INCREF(Py_Ellipsis);
+ return Py_Ellipsis;
+}
+
+static PyObject *
ellipsis_repr(PyObject *op)
{
return PyUnicode_FromString("Ellipsis");
@@ -43,6 +54,24 @@ PyTypeObject PyEllipsis_Type = {
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT, /* tp_flags */
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* 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 */
+ ellipsis_new, /* tp_new */
};
PyObject _Py_EllipsisObject = {