]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Change list.extend() error msgs and NEWS to reflect that list.extend()
authorTim Peters <tim.peters@gmail.com>
Sat, 26 May 2001 19:37:54 +0000 (19:37 +0000)
committerTim Peters <tim.peters@gmail.com>
Sat, 26 May 2001 19:37:54 +0000 (19:37 +0000)
now takes any iterable argument, not only sequences.

NEEDS DOC CHANGES -- but I don't think we settled on a concise way to
say this stuff.

Misc/NEWS
Objects/listobject.c

index 1dc300d4a114d17a5656a07ba2eb317c2eb2f69e..3a15837fc99d37b1587a614d72c2790bd9f25847 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -100,7 +100,8 @@ Core
     map(), filter(), reduce(), zip()
     list(), tuple() (PySequence_Tuple() and PySequence_Fast() in C API)
     max(), min()
-    .join() method of strings
+    join() method of strings
+    extend() method of lists
     'x in y' and 'x not in y' (PySequence_Contains() in C API)
     operator.countOf() (PySequence_Count() in C API)
 
index 9fb3e8250b5ea088b57e9819f4a25dfe0e21d126..e595c85082501a0c98b0bcec93a2002bd52e9b8a 100644 (file)
@@ -644,7 +644,7 @@ listextend_internal(PyListObject *self, PyObject *b)
 static PyObject *
 list_inplace_concat(PyListObject *self, PyObject *other)
 {
-       other = PySequence_Fast(other, "argument to += must be a sequence");
+       other = PySequence_Fast(other, "argument to += must be iterable");
        if (!other)
                return NULL;
 
@@ -664,7 +664,7 @@ listextend(PyListObject *self, PyObject *args)
        if (!PyArg_ParseTuple(args, "O:extend", &b))
                return NULL;
 
-       b = PySequence_Fast(b, "list.extend() argument must be a sequence");
+       b = PySequence_Fast(b, "list.extend() argument must be iterable");
        if (!b)
                return NULL;