> > Perhaps a compromise could be to add a keyword parameter to request > such an exception? (We could even add three options: truncate, pad, > error, with truncate being the default, and pad being the old map() > and filter() behavior.)
FWIW, I intend to add an itertool called izip_longest() which allows a pad value to be specified. In deciding to accept that feature request, I put a great deal of thought and research into the idea. Along the way, I looked at other languages and found both truncating and padding versions of zip but did not find any version that raised an exception. IMO, such a provision would foul the waters and complicate the use of an otherwise simple function. Until now, there have been zero requests for zip() to have exception raising behavior. For Python 3k, I recommend: * simply replacing zip() with itertools.izip() * keeping the zip_longest() in a separate module * punting on an exception raising version The first covers 99% of use cases. The second covers a handful of situations that are otherwise difficult to deal with. The third is a YAGNI. Raymond _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
