[Python-3000] have zip() raise exception for sequences of different lengths

Raymond Hettinger rhettinger at ewtllc.com
Thu Aug 31 01:58:04 CEST 2006


>If changing zip()'s behavior to match the most common use case is
>totally out, the stdlib code at least argues for adding something like
>itertools.izip_exact().
>  
>

I open to that.

For this time being, let's do this.  Add itertools.izip_longest() in 
Py2.5 and include a recipe for izip_exact() and see if anyone cares 
enough to ever use it.  The new any() and all() functions started out as 
recipes and graduated when their popularity was shown.  If izip_exact() 
proves its worth, then I would be happy to add it as a tool.


Raymond



More information about the Python-3000 mailing list