[Python-checkins] python/dist/src/Modules itertoolsmodule.c, 1.18, 1.19

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Thu Aug 7 23:10:43 EDT 2003


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv14440/Modules

Modified Files:
	itertoolsmodule.c 
Log Message:
Modified itertools.izip() to match the behavior of __builtin__.zip()
which can now take zero arguments.



Index: itertoolsmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/itertoolsmodule.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** itertoolsmodule.c	14 Jul 2003 07:07:12 -0000	1.18
--- itertoolsmodule.c	8 Aug 2003 05:10:41 -0000	1.19
***************
*** 1511,1520 ****
  	int tuplesize = PySequence_Length(args);
  
- 	if (tuplesize < 1) {
- 		PyErr_SetString(PyExc_TypeError,
- 				"izip() requires at least one sequence");
- 		return NULL;
- 	}
- 
  	/* args must be a tuple */
  	assert(PyTuple_Check(args));
--- 1511,1514 ----
***************
*** 1599,1602 ****
--- 1593,1598 ----
  	PyObject *item;
  
+ 	if (tuplesize == 0)
+ 		return NULL;
  	if (result->ob_refcnt == 1) {
  		for (i=0 ; i < tuplesize ; i++) {





More information about the Python-checkins mailing list