# HG changeset patch # Parent f08d5638798234c72381f30dc6c8fa747d45fd34 Issue #16701: Document += and *= for mutable sequences diff -r f08d56387982 Doc/library/stdtypes.rst --- a/Doc/library/stdtypes.rst Sun Sep 20 01:11:50 2015 +0000 +++ b/Doc/library/stdtypes.rst Thu Sep 24 01:10:11 2015 +0000 @@ -1063,9 +1063,12 @@ | ``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[len(s):len(s)] = t``) | | +| ``s.extend(t)`` or | extends *s* with the contents | | +| ``s += t`` | of *t* (usually 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* | | @@ -1107,6 +1110,12 @@ .. 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: