From 3bc6d31633dd7c67f5a5b745e131bff517e97cc2 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Mon, 24 Jul 2000 17:40:00 +0000 Subject: [PATCH] Added a few more open issues: - what should "zip()" do (i.e. zip with no arguments). - should zip() be included in the builtins? - the padtuple proposal --- pep-0201.txt | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/pep-0201.txt b/pep-0201.txt index 62f84b4b1..c6ae98d9b 100644 --- a/pep-0201.txt +++ b/pep-0201.txt @@ -125,7 +125,8 @@ The Proposed Solution It is not possible to pad short lists with different pad values, nor will zip() ever raise an exception with lists of different lengths. To accomplish either behavior, the sequences must be - checked and processed before the call to zip(). + checked and processed before the call to zip() -- but see the Open + Issues below for more discussion. @@ -390,6 +391,14 @@ Open Issues Current scoring seems to generally favor outcome 1. + - What should "zip()" do? + + Along similar lines, zip() with no arguments (or zip() with just + a pad argument) can have ambiguous semantics. Should this + return no elements or an infinite number? For these reaons, + raising a TypeError exception in this case makes the most + sense. + - The name of the built-in `zip' may cause some initial confusion with the zip compression algorithm. Other suggestions include (but are not limited to!): marry, weave, parallel, lace, braid, @@ -399,6 +408,24 @@ Open Issues with `zip' because the same functionality is available in other languages (e.g. Haskell) under the name `zip'[2]. + - Should zip() be including in the builtins module or should it be + in a separate generators module (possibly with other candidate + functions like irange())? + + - Padding short sequences with different values. A suggestion has + been made to allow a `padtuple' (probably better called `pads' + or `padseq') argument similar to `pad'. This sequence must have + a length equal to the number of sequences given. It is a + sequence of the individual pad values to use for each sequence, + should it be shorter than the maximum length. + + One problem is what to do if `padtuple' itself isn't of the + right length? A TypeError seems to be the only choice here. + + How does `pad' and `padtuple' interact? Perhaps if padtuple + were too short, it could use pad as a fallback. padtuple would + always override pad if both were given. + References