[Python-checkins] r66913 - python/trunk/Doc/library/collections.rst

benjamin.peterson python-checkins at python.org
Thu Oct 16 20:52:15 CEST 2008


Author: benjamin.peterson
Date: Thu Oct 16 20:52:14 2008
New Revision: 66913

Log:
document that deque indexing is O(n) #4123

Modified:
   python/trunk/Doc/library/collections.rst

Modified: python/trunk/Doc/library/collections.rst
==============================================================================
--- python/trunk/Doc/library/collections.rst	(original)
+++ python/trunk/Doc/library/collections.rst	Thu Oct 16 20:52:14 2008
@@ -247,7 +247,9 @@
 
 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:
 


More information about the Python-checkins mailing list