diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-10-16 18:52:14 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-10-16 18:52:14 (GMT) |
commit | 5c4e006367fcfb2cac3581080637976d0bd83921 (patch) | |
tree | 3db7d035780ca778aeae104d52e3c83912695465 /Doc | |
parent | 61376409a9ff1d7e218f3945d0565719b6bfefb4 (diff) | |
download | cpython-5c4e006367fcfb2cac3581080637976d0bd83921.zip cpython-5c4e006367fcfb2cac3581080637976d0bd83921.tar.gz cpython-5c4e006367fcfb2cac3581080637976d0bd83921.tar.bz2 |
document that deque indexing is O(n) #4123
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/collections.rst | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index a66b555..258b54f 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -247,7 +247,9 @@ Notes on using :class:`Set` and :class:`MutableSet` as a mixin: 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]``. +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. Example: |