return NULL; Py_INCREF(Py_None); return Py_None;} PyDoc_STRVAR(setattr_doc,"setattr(object, name, value)\n\\n\Set a named attribute on an object; setattr(x, 'y', v) is equivalent to\n\``x.y = v''."); static PyObject *builtin_delattr(PyObject *self, PyObject *args){ PyObject *v; PyObject *name; if (!PyArg_UnpackTuple(args, "delattr", 2, 2, &v, &name)) return NULL; if (PyObject_SetAttr(v, name, (PyObject *)NULL) != 0) return NULL; Py_INCREF(Py_None); return Py_None;} PyDoc_STRVAR(delattr_doc,"delattr(object, name)\n\\n\Delete a named attribute on an object; delattr(x, 'y') is equivalent to\n\``del x.y''."); static PyObject *builtin_hash(PyObject *self, PyObject *v){ long x; x = PyObject_Hash(v); if (x == -1) return NULL; return PyInt_FromLong(x);} PyDoc_STRVAR(hash_doc,"hash(object) -> integer\n\\n\Return a hash value for the object. Two objects with the same value have\n\the same hash value. The reverse is not necessarily true, but likely."); static PyObject *builtin_hex(PyObject *self, PyObject *v){ PyNumberMethods *nb; PyObject *res; if ((nb = v->ob_type->tp_as_number) == NULL || nb->nb_hex == NULL) { PyErr_SetString(PyExc_TypeError, "hex() argument can't be converted to hex"); return NULL; } res = (*nb->nb_hex)(v); if (res && !PyString_Check(res)) { PyErr_Format(PyExc_TypeError, "__hex__ returned non-string (type %.200s)", res->ob_type->tp_name); Py_DECREF(res); return NULL; } return res;} PyDoc_STRVAR(hex_doc,"hex(number) -> string\n\\n\Return the hexadecimal representation of an integer or long integer."); static PyObject *builtin_raw_input(PyObject *, PyObject *); static PyObject *builtin_input(PyObject *self, PyObject *args){ PyObject *line; char *str; PyObject *res; PyObject *globals, *locals; PyCompilerFlags cf; line = builtin_raw_input(self, args); if (line == NULL) return line; if (!PyArg_Parse(line, "s;embedded '\\0' in input line", &str)) return NULL; while (*str == ' ' || *str == '\t') str++; globals = PyEval_GetGlobals(); locals = PyEval_GetLocals(); if (PyDict_GetItemString(globals, "__builtins__") == NULL) { if (PyDict_SetItemString(globals, "__builtins__", PyEval_GetBuiltins()) != 0) return NULL; } cf.cf_flags = 0; PyEval_MergeCompilerFlags(&cf); res = PyRun_StringFlags(str, Py_eval_input, globals, locals, &cf); Py_DECREF(line); return res;} PyDoc_STRVAR(input_doc,"input([prompt]) -> value\n\\n\Equivalent to eval(raw_input(prompt))."); static PyObject *builtin_intern(PyObject *self, PyObject *args){ PyObject *s; if (!PyArg_ParseTuple(args, "S:intern", &s)) return NULL; if (!PyString_CheckExact(s)) { PyErr_SetString(PyExc_TypeError, "can't intern subclass of string"); return NULL; } Py_INCREF(s); PyString_InternInPlace(&s); return s;} PyDoc_STRVAR(intern_doc,"intern(string) -> string\n\\n\``Intern'' the given string. This enters the string in the (global)\n\table of interned strings whose purpose is to speed up dictionary lookups.\n\Return the string itself or the previously interned string object with the\n\same value."); static PyObject *builtin_iter(PyObject *self, PyObject *args){ PyObject *v, *w = NULL; if (!PyArg_UnpackTuple(args, "iter", 1, 2, &v, &w)) return NULL; if (w == NULL) return PyObject_GetIter(v); if (!PyCallable_Check(v)) { PyErr_SetString(PyExc_TypeError, "iter(v, w): v must be callable"); return NULL; } return PyCallIter_New(v, w);} PyDoc_STRVAR(iter_doc,"iter(collection) -> iterator\n\iter(callable, sentinel) -> iterator\n\\n\Get an iterator from an object. In the first form, the argument must\n\supply its own iterator, or be a sequence.\n\In the second form, the callable is called until it returns the sentinel."); static PyObject *builtin_len(PyObject *self, PyObject *v){ Py_ssize_t res; res = PyObject_Size(v); if (res < 0 && PyErr_Occurred()) return NULL; return PyInt_FromSsize_t(res);} PyDoc_STRVAR(len_doc,"len(object) -> integer\n\\n\Return the number of items of a sequence or mapping."); static PyObject *builtin_locals(PyObject *self){ PyObject *d; d = PyEval_GetLocals(); Py_XINCREF(d); return d;} PyDoc_STRVAR(locals_doc,"locals() -> dictionary\n\\n\Update and return a dictionary containing the current scope's local variables."); static PyObject *min_max(PyObject *args, PyObject *kwds, int op){ PyObject *v, *it, *item, *val, *maxitem, *maxval, *keyfunc=NULL; const char *name = op == Py_LT ? "min" : "max"; if (PyTuple_Size(args) > 1) v = args; else if (!PyArg_UnpackTuple(args, (char *)name, 1, 1, &v)) return NULL; if (kwds != NULL && PyDict_Check(kwds) && PyDict_Size(kwds)) { keyfunc = PyDict_GetItemString(kwds, "key"); if (PyDict_Size(kwds)!=1 || keyfunc == NULL) { PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument", name); return NULL; } } it = PyObject_GetIter(v); if (it == NULL) return NULL; maxitem = NULL; /* the result */ maxval = NULL; /* the value associated with the result */ while (( item = PyIter_Next(it) )) { /* get the value from the key function */ if (keyfunc != NULL) { val = PyObject_CallFunctionObjArgs(keyfunc, item, NULL); if (val == NULL) goto Fail_it_item; } /* no key function; the value is the item */ else { val = item; Py_INCREF(val); } /* maximum value and item are unset; set them */ if (maxval == NULL) { maxitem = item; maxval = val; } /* maximum value and item are set; update them as necessary */ else { int cmp = PyObject_RichCompareBool(val, maxval, op); if (cmp < 0) goto Fail_it_item_and_val; else if (cmp > 0) { Py_DECREF(maxval); Py_DECREF(maxitem); maxval = val; maxitem = item; } else { Py_DECREF(item); Py_DECREF(val); } } } if (PyErr_Occurred()) goto Fail_it; if (maxval == NULL) { PyErr_Format(PyExc_ValueError, "%s() arg is an empty sequence", name); assert(maxitem == NULL); } else Py_DECREF(maxval); Py_DECREF(it); return maxitem; Fail_it_item_and_val: Py_DECREF(val);Fail_it_item: Py_DECREF(item);Fail_it: Py_XDECREF(maxval); Py_XDECREF(maxitem); Py_DECREF(it); return NULL;} static PyObject *builtin_min(PyObject *self, PyObject *args, PyObject *kwds){ return min_max(args, kwds, Py_LT);} PyDoc_STRVAR(min_doc,"min(iterable[, key=func]) -> value\n\min(a, b, c, ...[, key=func]) -> value\n\\n\With a single iterable argument, return its smallest item.\n\With two or more arguments, return the smallest argument."); static PyObject *builtin_max(PyObject *self, PyObject *args, PyObject *kwds){ return min_max(args, kwds, Py_GT);} PyDoc_STRVAR(max_doc,"max(iterable[, key=func]) -> value\n\max(a, b, c, ...[, key=func]) -> value\n\\n\With a single iterable argument, return its largest item.\n\With two or more arguments, return the largest argument."); static PyObject *builtin_oct(PyObject *self, PyObject *v){ PyNumberMethods *nb; PyObject *res; if (v == NULL || (nb = v->ob_type->tp_as_number) == NULL || nb->nb_oct == NULL) { PyErr_SetString(PyExc_TypeError, "oct() argument can't be converted to oct"); return NULL; } res = (*nb->nb_oct)(v); if (res && !PyString_Check(res)) { PyErr_Format(PyExc_TypeError, "__oct__ returned non-string (type %.200s)", res->ob_type->tp_name); Py_DECREF(res); return NULL; } return res;} PyDoc_STRVAR(oct_doc,"oct(number) -> string\n\\n\Return the octal representation of an integer or long integer."); static PyObject *builtin_open(PyObject *self, PyObject *args, PyObject *kwds){ return PyObject_Call((PyObject*)&PyFile_Type, args, kwds);} PyDoc_STRVAR(open_doc,"open(name[, mode[, buffering]]) -> file object\n\\n\Open a file using the file() type, returns a file object."); static PyObject *builtin_ord(PyObject *self, PyObject* obj){ long ord; Py_ssize_t size; if (PyString_Check(obj)) { size = PyString_GET_SIZE(obj); if (size == 1) { ord = (long)((unsigned char)*PyString_AS_STRING(obj)); return PyInt_FromLong(ord); }#ifdef Py_USING_UNICODE } else if (PyUnicode_Check(obj)) { size = PyUnicode_GET_SIZE(obj); if (size == 1) { ord = (long)*PyUnicode_AS_UNICODE(obj); return PyInt_FromLong(ord); }#endif } else { PyErr_Format(PyExc_TypeError, "ord() expected string of length 1, but " \ "%.200s found", obj->ob_type->tp_name); return NULL; } PyErr_Format(PyExc_TypeError, "ord() expected a character, " "but string of length %zd found", size); return NULL;} PyDoc_STRVAR(ord_doc,"ord(c) -> integer\n\\n\Return the integer ordinal of a one-character string."); static PyObject *builtin_pow(PyObject *self, PyObject *args){ PyObject *v, *w, *z = Py_None; if (!PyArg_UnpackTuple(args, "pow", 2, 3, &v, &w, &z)) return NULL; return PyNumber_Power(v, w, z);} PyDoc_STRVAR(pow_doc,"pow(x, y[, z]) -> number\n\\n\With two arguments, equivalent to x**y. With three arguments,\n\equivalent to (x**y) % z, but may be more efficient (e.g. for longs)."); /* Return number of items in range (lo, hi, step), when arguments are * PyInt or PyLong objects. step > 0 required. Return a value < 0 if * & only if the true value is too large to fit in a signed long. * Arguments MUST return 1 with either PyInt_Check() or * PyLong_Check(). Return -1 when there is an error. */static longget_len_of_range_longs(PyObject *lo, PyObject *hi, PyObject *step){ /* ------------------------------------------------------------- Algorithm is equal to that of get_len_of_range(), but it operates on PyObjects (which are assumed to be PyLong or PyInt objects). ---------------------------------------------------------------*/ long n; PyObject *diff = NULL; PyObject *one = NULL; PyObject *tmp1 = NULL, *tmp2 = NULL, *tmp3 = NULL; /* holds sub-expression evaluations */ /* if (lo >= hi), return length of 0. */ if (PyObject_Compare(lo, hi) >= 0) return 0; if ((one = PyLong_FromLong(1L)) == NULL) goto Fail; if ((tmp1 = PyNumber_Subtract(hi, lo)) == NULL) goto Fail; if ((diff = PyNumber_Subtract(tmp1, one)) == NULL) goto Fail; if ((tmp2 = PyNumber_FloorDivide(diff, step)) == NULL) goto Fail; if ((tmp3 = PyNumber_Add(tmp2, one)) == NULL) goto Fail; n = PyLong_AsLong(tmp3); if (PyErr_Occurred()) { /* Check for Overflow */ PyErr_Clear(); goto Fail; } Py_DECREF(tmp3); Py_DECREF(tmp2); Py_DECREF(diff); Py_DECREF(tmp1); Py_DECREF(one); return n; Fail: Py_XDECREF(tmp3); Py_XDECREF(tmp2); Py_XDECREF(diff); Py_XDECREF(tmp1); Py_XDECREF(one); return -1;} /* An extension of builtin_range() that handles the case when PyLong * arguments are given. */static PyObject *handle_range_longs(PyObject *self, PyObject *args){ PyObject *ilow; PyObject *ihigh = NULL; PyObject *istep = NULL; PyObject *curnum = NULL; PyObject *v = NULL; long bign; int i, n; int cmp_result; PyObject *zero = PyLong_FromLong(0); if (zero == NULL) return NULL; if (!PyArg_UnpackTuple(args, "range", 1, 3, &ilow, &ihigh, &istep)) { Py_DECREF(zero); return NULL; } /* Figure out which way we were called, supply defaults, and be * sure to incref everything so that the decrefs at the endLines 1001–1500 of 2620. Previous lines Load more
return NULL; Py_INCREF(Py_None); return Py_None; } PyDoc_STRVAR(setattr_doc, "setattr(object, name, value)\n\ \n\ Set a named attribute on an object; setattr(x, 'y', v) is equivalent to\n\ ``x.y = v''."); static PyObject * builtin_delattr(PyObject *self, PyObject *args) { PyObject *v; PyObject *name; if (!PyArg_UnpackTuple(args, "delattr", 2, 2, &v, &name)) return NULL; if (PyObject_SetAttr(v, name, (PyObject *)NULL) != 0) return NULL; Py_INCREF(Py_None); return Py_None; } PyDoc_STRVAR(delattr_doc, "delattr(object, name)\n\ \n\ Delete a named attribute on an object; delattr(x, 'y') is equivalent to\n\ ``del x.y''."); static PyObject * builtin_hash(PyObject *self, PyObject *v) { long x; x = PyObject_Hash(v); if (x == -1) return NULL; return PyInt_FromLong(x); } PyDoc_STRVAR(hash_doc, "hash(object) -> integer\n\ \n\ Return a hash value for the object. Two objects with the same value have\n\ the same hash value. The reverse is not necessarily true, but likely."); static PyObject * builtin_hex(PyObject *self, PyObject *v) { PyNumberMethods *nb; PyObject *res; if ((nb = v->ob_type->tp_as_number) == NULL || nb->nb_hex == NULL) { PyErr_SetString(PyExc_TypeError, "hex() argument can't be converted to hex"); return NULL; } res = (*nb->nb_hex)(v); if (res && !PyString_Check(res)) { PyErr_Format(PyExc_TypeError, "__hex__ returned non-string (type %.200s)", res->ob_type->tp_name); Py_DECREF(res); return NULL; } return res; } PyDoc_STRVAR(hex_doc, "hex(number) -> string\n\ \n\ Return the hexadecimal representation of an integer or long integer."); static PyObject *builtin_raw_input(PyObject *, PyObject *); static PyObject * builtin_input(PyObject *self, PyObject *args) { PyObject *line; char *str; PyObject *res; PyObject *globals, *locals; PyCompilerFlags cf; line = builtin_raw_input(self, args); if (line == NULL) return line; if (!PyArg_Parse(line, "s;embedded '\\0' in input line", &str)) return NULL; while (*str == ' ' || *str == '\t') str++; globals = PyEval_GetGlobals(); locals = PyEval_GetLocals(); if (PyDict_GetItemString(globals, "__builtins__") == NULL) { if (PyDict_SetItemString(globals, "__builtins__", PyEval_GetBuiltins()) != 0) return NULL; } cf.cf_flags = 0; PyEval_MergeCompilerFlags(&cf); res = PyRun_StringFlags(str, Py_eval_input, globals, locals, &cf); Py_DECREF(line); return res; } PyDoc_STRVAR(input_doc, "input([prompt]) -> value\n\ \n\ Equivalent to eval(raw_input(prompt))."); static PyObject * builtin_intern(PyObject *self, PyObject *args) { PyObject *s; if (!PyArg_ParseTuple(args, "S:intern", &s)) return NULL; if (!PyString_CheckExact(s)) { PyErr_SetString(PyExc_TypeError, "can't intern subclass of string"); return NULL; } Py_INCREF(s); PyString_InternInPlace(&s); return s; } PyDoc_STRVAR(intern_doc, "intern(string) -> string\n\ \n\ ``Intern'' the given string. This enters the string in the (global)\n\ table of interned strings whose purpose is to speed up dictionary lookups.\n\ Return the string itself or the previously interned string object with the\n\ same value."); static PyObject * builtin_iter(PyObject *self, PyObject *args) { PyObject *v, *w = NULL; if (!PyArg_UnpackTuple(args, "iter", 1, 2, &v, &w)) return NULL; if (w == NULL) return PyObject_GetIter(v); if (!PyCallable_Check(v)) { PyErr_SetString(PyExc_TypeError, "iter(v, w): v must be callable"); return NULL; } return PyCallIter_New(v, w); } PyDoc_STRVAR(iter_doc, "iter(collection) -> iterator\n\ iter(callable, sentinel) -> iterator\n\ \n\ Get an iterator from an object. In the first form, the argument must\n\ supply its own iterator, or be a sequence.\n\ In the second form, the callable is called until it returns the sentinel."); static PyObject * builtin_len(PyObject *self, PyObject *v) { Py_ssize_t res; res = PyObject_Size(v); if (res < 0 && PyErr_Occurred()) return NULL; return PyInt_FromSsize_t(res); } PyDoc_STRVAR(len_doc, "len(object) -> integer\n\ \n\ Return the number of items of a sequence or mapping."); static PyObject * builtin_locals(PyObject *self) { PyObject *d; d = PyEval_GetLocals(); Py_XINCREF(d); return d; } PyDoc_STRVAR(locals_doc, "locals() -> dictionary\n\ \n\ Update and return a dictionary containing the current scope's local variables."); static PyObject * min_max(PyObject *args, PyObject *kwds, int op) { PyObject *v, *it, *item, *val, *maxitem, *maxval, *keyfunc=NULL; const char *name = op == Py_LT ? "min" : "max"; if (PyTuple_Size(args) > 1) v = args; else if (!PyArg_UnpackTuple(args, (char *)name, 1, 1, &v)) return NULL; if (kwds != NULL && PyDict_Check(kwds) && PyDict_Size(kwds)) { keyfunc = PyDict_GetItemString(kwds, "key"); if (PyDict_Size(kwds)!=1 || keyfunc == NULL) { PyErr_Format(PyExc_TypeError, "%s() got an unexpected keyword argument", name); return NULL; } } it = PyObject_GetIter(v); if (it == NULL) return NULL; maxitem = NULL; /* the result */ maxval = NULL; /* the value associated with the result */ while (( item = PyIter_Next(it) )) { /* get the value from the key function */ if (keyfunc != NULL) { val = PyObject_CallFunctionObjArgs(keyfunc, item, NULL); if (val == NULL) goto Fail_it_item; } /* no key function; the value is the item */ else { val = item; Py_INCREF(val); } /* maximum value and item are unset; set them */ if (maxval == NULL) { maxitem = item; maxval = val; } /* maximum value and item are set; update them as necessary */ else { int cmp = PyObject_RichCompareBool(val, maxval, op); if (cmp < 0) goto Fail_it_item_and_val; else if (cmp > 0) { Py_DECREF(maxval); Py_DECREF(maxitem); maxval = val; maxitem = item; } else { Py_DECREF(item); Py_DECREF(val); } } } if (PyErr_Occurred()) goto Fail_it; if (maxval == NULL) { PyErr_Format(PyExc_ValueError, "%s() arg is an empty sequence", name); assert(maxitem == NULL); } else Py_DECREF(maxval); Py_DECREF(it); return maxitem; Fail_it_item_and_val: Py_DECREF(val); Fail_it_item: Py_DECREF(item); Fail_it: Py_XDECREF(maxval); Py_XDECREF(maxitem); Py_DECREF(it); return NULL; } static PyObject * builtin_min(PyObject *self, PyObject *args, PyObject *kwds) { return min_max(args, kwds, Py_LT); } PyDoc_STRVAR(min_doc, "min(iterable[, key=func]) -> value\n\ min(a, b, c, ...[, key=func]) -> value\n\ \n\ With a single iterable argument, return its smallest item.\n\ With two or more arguments, return the smallest argument."); static PyObject * builtin_max(PyObject *self, PyObject *args, PyObject *kwds) { return min_max(args, kwds, Py_GT); } PyDoc_STRVAR(max_doc, "max(iterable[, key=func]) -> value\n\ max(a, b, c, ...[, key=func]) -> value\n\ \n\ With a single iterable argument, return its largest item.\n\ With two or more arguments, return the largest argument."); static PyObject * builtin_oct(PyObject *self, PyObject *v) { PyNumberMethods *nb; PyObject *res; if (v == NULL || (nb = v->ob_type->tp_as_number) == NULL || nb->nb_oct == NULL) { PyErr_SetString(PyExc_TypeError, "oct() argument can't be converted to oct"); return NULL; } res = (*nb->nb_oct)(v); if (res && !PyString_Check(res)) { PyErr_Format(PyExc_TypeError, "__oct__ returned non-string (type %.200s)", res->ob_type->tp_name); Py_DECREF(res); return NULL; } return res; } PyDoc_STRVAR(oct_doc, "oct(number) -> string\n\ \n\ Return the octal representation of an integer or long integer."); static PyObject * builtin_open(PyObject *self, PyObject *args, PyObject *kwds) { return PyObject_Call((PyObject*)&PyFile_Type, args, kwds); } PyDoc_STRVAR(open_doc, "open(name[, mode[, buffering]]) -> file object\n\ \n\ Open a file using the file() type, returns a file object."); static PyObject * builtin_ord(PyObject *self, PyObject* obj) { long ord; Py_ssize_t size; if (PyString_Check(obj)) { size = PyString_GET_SIZE(obj); if (size == 1) { ord = (long)((unsigned char)*PyString_AS_STRING(obj)); return PyInt_FromLong(ord); } #ifdef Py_USING_UNICODE } else if (PyUnicode_Check(obj)) { size = PyUnicode_GET_SIZE(obj); if (size == 1) { ord = (long)*PyUnicode_AS_UNICODE(obj); return PyInt_FromLong(ord); } #endif } else { PyErr_Format(PyExc_TypeError, "ord() expected string of length 1, but " \ "%.200s found", obj->ob_type->tp_name); return NULL; } PyErr_Format(PyExc_TypeError, "ord() expected a character, " "but string of length %zd found", size); return NULL; } PyDoc_STRVAR(ord_doc, "ord(c) -> integer\n\ \n\ Return the integer ordinal of a one-character string."); static PyObject * builtin_pow(PyObject *self, PyObject *args) { PyObject *v, *w, *z = Py_None; if (!PyArg_UnpackTuple(args, "pow", 2, 3, &v, &w, &z)) return NULL; return PyNumber_Power(v, w, z); } PyDoc_STRVAR(pow_doc, "pow(x, y[, z]) -> number\n\ \n\ With two arguments, equivalent to x**y. With three arguments,\n\ equivalent to (x**y) % z, but may be more efficient (e.g. for longs)."); /* Return number of items in range (lo, hi, step), when arguments are * PyInt or PyLong objects. step > 0 required. Return a value < 0 if * & only if the true value is too large to fit in a signed long. * Arguments MUST return 1 with either PyInt_Check() or * PyLong_Check(). Return -1 when there is an error. */ static long get_len_of_range_longs(PyObject *lo, PyObject *hi, PyObject *step) { /* ------------------------------------------------------------- Algorithm is equal to that of get_len_of_range(), but it operates on PyObjects (which are assumed to be PyLong or PyInt objects). ---------------------------------------------------------------*/ long n; PyObject *diff = NULL; PyObject *one = NULL; PyObject *tmp1 = NULL, *tmp2 = NULL, *tmp3 = NULL; /* holds sub-expression evaluations */ /* if (lo >= hi), return length of 0. */ if (PyObject_Compare(lo, hi) >= 0) return 0; if ((one = PyLong_FromLong(1L)) == NULL) goto Fail; if ((tmp1 = PyNumber_Subtract(hi, lo)) == NULL) goto Fail; if ((diff = PyNumber_Subtract(tmp1, one)) == NULL) goto Fail; if ((tmp2 = PyNumber_FloorDivide(diff, step)) == NULL) goto Fail; if ((tmp3 = PyNumber_Add(tmp2, one)) == NULL) goto Fail; n = PyLong_AsLong(tmp3); if (PyErr_Occurred()) { /* Check for Overflow */ PyErr_Clear(); goto Fail; } Py_DECREF(tmp3); Py_DECREF(tmp2); Py_DECREF(diff); Py_DECREF(tmp1); Py_DECREF(one); return n; Fail: Py_XDECREF(tmp3); Py_XDECREF(tmp2); Py_XDECREF(diff); Py_XDECREF(tmp1); Py_XDECREF(one); return -1; } /* An extension of builtin_range() that handles the case when PyLong * arguments are given. */ static PyObject * handle_range_longs(PyObject *self, PyObject *args) { PyObject *ilow; PyObject *ihigh = NULL; PyObject *istep = NULL; PyObject *curnum = NULL; PyObject *v = NULL; long bign; int i, n; int cmp_result; PyObject *zero = PyLong_FromLong(0); if (zero == NULL) return NULL; if (!PyArg_UnpackTuple(args, "range", 1, 3, &ilow, &ihigh, &istep)) { Py_DECREF(zero); return NULL; } /* Figure out which way we were called, supply defaults, and be * sure to incref everything so that the decrefs at the end