diff options
author | Windson yang <wiwindson@outlook.com> | 2018-11-04 22:34:22 (GMT) |
---|---|---|
committer | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2018-11-04 22:34:22 (GMT) |
commit | 98b85354153883b0a080f678f213729cd0764fee (patch) | |
tree | a151d8f025145609eacebe872a01635b1f8e3f8a /Doc/library/collections.rst | |
parent | 55f3317e984cc35bd18ba0326ed98766a2750ffd (diff) | |
download | cpython-98b85354153883b0a080f678f213729cd0764fee.zip cpython-98b85354153883b0a080f678f213729cd0764fee.tar.gz cpython-98b85354153883b0a080f678f213729cd0764fee.tar.bz2 |
bpo-35118: Improve docs regarding indexing (GH-10265)
Diffstat (limited to 'Doc/library/collections.rst')
-rw-r--r-- | Doc/library/collections.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index 495cfc2..6b9d85a 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -531,9 +531,9 @@ or subtracting from an empty counter. In addition to the above, deques support iteration, pickling, ``len(d)``, ``reversed(d)``, ``copy.copy(d)``, ``copy.deepcopy(d)``, membership testing with -the :keyword:`in` operator, and subscript references such as ``d[-1]``. Indexed -access is O(1) at both ends but slows to O(n) in the middle. For fast random -access, use lists instead. +the :keyword:`in` operator, and subscript references such as ``d[0]`` to access +the first element. Indexed access is O(1) at both ends but slows to O(n) in +the middle. For fast random access, use lists instead. Starting in version 3.5, deques support ``__add__()``, ``__mul__()``, and ``__imul__()``. |