diff Doc/lib/libstdtypes.tex @ 9318:8a26e55e18b8 legacy-trunk

Document the new list.extend() method. Interesting enough, the canonical definition of extend() is very similar to append() except that the former doesn't list-ify the argument!
author Barry Warsaw <barry@python.org>
date Fri, 09 Oct 1998 16:39:58 +0000
parents bc41e86c938c
children 9ffd604807c2
line wrap: on
line diff
--- a/Doc/lib/libstdtypes.tex	Fri Oct 09 16:37:25 1998 +0000
+++ b/Doc/lib/libstdtypes.tex	Fri Oct 09 16:39:58 1998 +0000
@@ -452,6 +452,8 @@
 	{same as \code{\var{s}[\var{i}:\var{j}] = []}}{}
   \lineiii{\var{s}.append(\var{x})}
 	{same as \code{\var{s}[len(\var{s}):len(\var{s})] = [\var{x}]}}{}
+  \lineiii{\var{s}.extend(\var{x})}
+        {same as \code{\var{s}[len(\var{s}):len(\var{s})] = \var{x}}}{(5)}
   \lineiii{\var{s}.count(\var{x})}
     {return number of \var{i}'s for which \code{\var{s}[\var{i}] == \var{x}}}{}
   \lineiii{\var{s}.index(\var{x})}
@@ -476,6 +478,7 @@
 \stindex{del}
 \withsubitem{(list method)}{%
   \ttindex{append}%
+  \ttindex{extend}%
   \ttindex{count}%
   \ttindex{index}%
   \ttindex{insert}%
@@ -509,6 +512,9 @@
 The optional argument \var{i} defaults to \code{-1}, so that
 by default the last item is removed and returned.
 
+\item[(5)] Raises an exception when \var{x} is not a list object.  The 
+\method{extend()} method is experimental and not supported by mutable types
+other than lists.
 \end{description}