Beef-up docs and tests for itertools. Fix-up end-case for product().

This commit is contained in:
Raymond Hettinger 2008-03-04 04:17:08 +00:00
parent 378586a844
commit d553d856e7
3 changed files with 145 additions and 19 deletions

View file

@ -1885,10 +1885,7 @@ product_next(productobject *lz)
if (result == NULL) {
/* On the first pass, return an initial tuple filled with the
first element from each pool. If any pool is empty, then
whole product is empty and we're already done */
if (npools == 0)
goto empty;
first element from each pool. */
result = PyTuple_New(npools);
if (result == NULL)
goto empty;