]> granicus.if.org Git - python/commitdiff
document that deque indexing is O(n) #4123
authorBenjamin Peterson <benjamin@python.org>
Thu, 16 Oct 2008 18:52:14 +0000 (18:52 +0000)
committerBenjamin Peterson <benjamin@python.org>
Thu, 16 Oct 2008 18:52:14 +0000 (18:52 +0000)
Doc/library/collections.rst

index a66b555191d34953673aada9aa673238dd92d5d2..258b54fdc60951634b18cacdebbf52d40d3c5997 100644 (file)
@@ -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: