Mercurial > cpython-lru_cache-weakref
diff Python/bltinmodule.c @ 30037:0504ba8efbb6 legacy-trunk
As discussed on python-dev, changed builtin.zip() to handle zero arguments
by returning an empty list instead of raising a TypeError.
| author | Raymond Hettinger <python@rcn.com> |
|---|---|
| date | Sat, 02 Aug 2003 07:42:57 +0000 |
| parents | d3297e298211 |
| children | 9f53e53f3880 |
line wrap: on
line diff
--- a/Python/bltinmodule.c Fri Aug 01 14:20:02 2003 +0000 +++ b/Python/bltinmodule.c Sat Aug 02 07:42:57 2003 +0000 @@ -1916,11 +1916,9 @@ PyObject *itlist; /* tuple of iterators */ int len; /* guess at result length */ - if (itemsize < 1) { - PyErr_SetString(PyExc_TypeError, - "zip() requires at least one sequence"); - return NULL; - } + if (itemsize == 0) + return PyList_New(0); + /* args must be a tuple */ assert(PyTuple_Check(args));
