Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f8bcfb1

Browse files
committed
SF Bug 645777: list.extend() works with any iterable and is no longer
experimental.
1 parent 4643bd9 commit f8bcfb1

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

Doc/lib/libstdtypes.tex

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -946,9 +946,7 @@ \subsubsection{Mutable Sequence Types \label{typesseq-mutable}}
946946
Use of this misfeature has been deprecated since Python 1.4,
947947
and became an error with the introduction of Python 2.0.
948948

949-
\item[(2)] Raises an exception when \var{x} is not a list object. The
950-
\method{extend()} method is experimental and not supported by
951-
mutable sequence types other than lists.
949+
\item[(2)] Raises an exception when \var{x} is not an iterable object.
952950

953951
\item[(3)] Raises \exception{ValueError} when \var{x} is not found in
954952
\var{s}.

Objects/listobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2055,7 +2055,7 @@ list_nohash(PyObject *self)
20552055
PyDoc_STRVAR(append_doc,
20562056
"L.append(object) -- append object to end");
20572057
PyDoc_STRVAR(extend_doc,
2058-
"L.extend(sequence) -- extend list by appending sequence elements");
2058+
"L.extend(iterable) -- extend list by appending elements from the iterable");
20592059
PyDoc_STRVAR(insert_doc,
20602060
"L.insert(index, object) -- insert object before index");
20612061
PyDoc_STRVAR(pop_doc,

0 commit comments

Comments
 (0)