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

Raymond Hettinger rhettinger at ewtllc.com
Thu Aug 31 18:12:44 CEST 2006

>How about a keyword-only argument called finish which is a callable to
>deal with the problem?  When any sequence is exhausted, its position
>is filled with StopIteration, and then finish(result) is returned.

How about we resist the urge to complicate the snot out of a basic 
looping construct.  Hypergeneralization is more of a sin than premature 

It is important that zip() be left as dirt simple as possible.  In the 
tutorial (section 5.6), we're able to use short, simple examples to 
teach all of the fundamental looping techniques to total beginners in a 
way that lets them save their brain power for learning exceptions, 
classes, generators, packages, and whatnot.

Creative talent is being wasted here just to solve a non-problem.   
Please keep Py3k on track for cruft removal. We're seeing way too much 
discussion on random, screwball proposals rather that focusing on what 
really matters:  Keeping the tried and true while removing stuff we've 
always wanted to take away.


More information about the Python-3000 mailing list