summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2015-10-03 07:53:49 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2015-10-03 07:53:49 (GMT)
commit2b8cbf04df7c4e8ee8742793020df5405db8441b (patch)
treeedd986c64b20972e4fef3add6688e4e7a9816a7b /Doc/library
parenteb1fee935365edbf8f35520d40bbcd999ef5d964 (diff)
parent3795d12a0d6f2be8d0a062c3ba878fc4800e2db1 (diff)
downloadcpython-2b8cbf04df7c4e8ee8742793020df5405db8441b.zip
cpython-2b8cbf04df7c4e8ee8742793020df5405db8441b.tar.gz
cpython-2b8cbf04df7c4e8ee8742793020df5405db8441b.tar.bz2
Issue #16701: Merge sequence docs from 3.4 into 3.5
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/stdtypes.rst14
1 files changed, 12 insertions, 2 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index b3c9e23..f274edb 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -1063,10 +1063,14 @@ accepts integers that meet the value restriction ``0 <= x <= 255``).
| ``s.copy()`` | creates a shallow copy of ``s``| \(5) |
| | (same as ``s[:]``) | |
+------------------------------+--------------------------------+---------------------+
-| ``s.extend(t)`` | extends *s* with the | |
-| | contents of *t* (same as | |
+| ``s.extend(t)`` or | extends *s* with the | |
+| ``s += t`` | contents of *t* (for the | |
+| | most part the same as | |
| | ``s[len(s):len(s)] = t``) | |
+------------------------------+--------------------------------+---------------------+
+| ``s *= n`` | updates *s* with its contents | \(6) |
+| | repeated *n* times | |
++------------------------------+--------------------------------+---------------------+
| ``s.insert(i, x)`` | inserts *x* into *s* at the | |
| | index given by *i* | |
| | (same as ``s[i:i] = [x]``) | |
@@ -1107,6 +1111,12 @@ Notes:
.. versionadded:: 3.3
:meth:`clear` and :meth:`!copy` methods.
+(6)
+ The value *n* is an integer, or an object implementing
+ :meth:`~object.__index__`. Zero and negative values of *n* clear
+ the sequence. Items in the sequence are not copied; they are referenced
+ multiple times, as explained for ``s * n`` under :ref:`typesseq-common`.
+
.. _typesseq-list: