mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
Change list.extend() error msgs and NEWS to reflect that list.extend()
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.
This commit is contained in:
parent
442914d265
commit
1af03e98d9
2 changed files with 4 additions and 3 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue