[Python-checkins] peps: Added a few more open issues:
georg.brandl
python-checkins at python.org
Wed Mar 23 21:22:59 CET 2011
http://hg.python.org/peps/rev/a229a82a4f16
changeset: 34:a229a82a4f16
user: Barry Warsaw <barry at python.org>
date: Mon Jul 24 17:40:00 2000 +0000
summary:
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
files:
pep-0201.txt | 29 ++++++++++++++++++++++++++++-
1 files changed, 28 insertions(+), 1 deletions(-)
diff --git a/pep-0201.txt b/pep-0201.txt
--- a/pep-0201.txt
+++ b/pep-0201.txt
@@ -125,7 +125,8 @@
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 @@
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 @@
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
--
Repository URL: http://hg.python.org/peps
More information about the Python-checkins
mailing list