diff options
| author | Guido van Rossum <guido@python.org> | 2006-08-25 23:26:40 +0000 | 
|---|---|---|
| committer | Guido van Rossum <guido@python.org> | 2006-08-25 23:26:40 +0000 | 
| commit | b65fb33b022de9fefc8af76339f645c16614e2eb (patch) | |
| tree | 9a4bc79caeb5e03b5c198282a9d85589d62537a2 /Python/bltinmodule.c | |
| parent | e2e23ef97da1ce44c604d86d1f21c2701d7e581f (diff) | |
| download | cpython-git-b65fb33b022de9fefc8af76339f645c16614e2eb.tar.gz | |
SF patch 1546297 (with some tweaks):
Create a real zip iterator object; not using itertools.izip
(Brian Holmes).
Diffstat (limited to 'Python/bltinmodule.c')
| -rw-r--r-- | Python/bltinmodule.c | 18 | 
1 files changed, 3 insertions, 15 deletions
| diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 6ca2a283d4..200ec26f22 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -1855,22 +1855,10 @@ is a shortcut for issubclass(X, A) or issubclass(X, B) or ... (etc.).");  static PyObject*  builtin_zip(PyObject *self, PyObject *args)  { -	PyObject *itertools = NULL, *izip = NULL, *result = NULL; +	/* args must be a tuple */ +	assert(PyTuple_Check(args)); -	itertools = PyImport_ImportModule("itertools"); -	if (itertools == NULL) -		return NULL; -	 -	izip = PyObject_GetAttrString(itertools, "izip"); -	if (izip == NULL) -		goto done; - -	result = PyObject_Call(izip, args, NULL); - -  done: -	Py_XDECREF(itertools); -	Py_XDECREF(izip); -	return result; +	return _PyZip_CreateIter(args);  } | 
