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

Steven Bethard steven.bethard at gmail.com
Thu Aug 31 05:32:14 CEST 2006


On 8/30/06, Raymond Hettinger <rhettinger at ewtllc.com> wrote:

>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.izipexact().

I open to that. For this time being, let's do this. Add itertools.iziplongest() in Py2.5 and include a recipe for izipexact() 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 izipexact() proves its worth, then I would be happy to add it as a tool.

Fair enough. Michael Chermside provided a recipe here:

http://mail.python.org/pipermail/python-3000/2006-March/000160.html

Maybe there's a cleaner way to write this, but I couldn't spot one off-hand.

STeVe

I'm not in-sane. Indeed, I am so far out of sane that you appear a tiny blip on the distant coast of sanity. --- Bucky Katt, Get Fuzzy



More information about the Python-3000 mailing list