@@ -479,7 +479,8 @@ or subtracting from an empty counter.
479479 corresponding number of items are discarded from the opposite end. Bounded
480480 length deques provide functionality similar to the ``tail `` filter in
481481 Unix. They are also useful for tracking transactions and other pools of data
482- where only the most recent activity is of interest.
482+ where only the most recent activity is of interest. Passing a *maxlen *
483+ greater than :data: `sys.maxsize ` raises :exc: `ValueError `.
483484
484485
485486 Deque objects support the following methods:
@@ -591,9 +592,11 @@ or subtracting from an empty counter.
591592
592593In addition to the above, deques support iteration, pickling, ``len(d) ``,
593594``reversed(d) ``, ``copy.copy(d) ``, ``copy.deepcopy(d) ``, membership testing with
594- the :keyword: `in ` operator, and subscript references such as ``d[0] `` to access
595- the first element. Indexed access is *O *\ (1) at both ends but slows to *O *\ (*n *) in
596- the middle. For fast random access, use lists instead.
595+ the :keyword: `in ` operator, subscript references such as ``d[0] `` to access
596+ the first element, and slicing notation like ``d[i:j:k] `` which returns a new
597+ deque of the same type (including subclasses) while preserving ``maxlen ``.
598+ Indexed access is *O *\ (1). Slicing is *O *\ (k) where *k * is the number of
599+ elements in the slice.
597600
598601Starting in version 3.5, deques support ``__add__() ``, ``__mul__() ``,
599602and ``__imul__() ``.
0 commit comments