Kaydet (Commit) 5c4e0063 authored tarafından Benjamin Peterson's avatar Benjamin Peterson

document that deque indexing is O(n) #4123

üst 61376409
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment