diff -r cabd7261ae80 Doc/library/collections.rst --- a/Doc/library/collections.rst Fri May 22 19:29:22 2015 -0700 +++ b/Doc/library/collections.rst Sat May 23 14:21:19 2015 +0100 @@ -387,9 +387,18 @@ Section 4.6.3, Exercise 19*. * To enumerate all distinct multisets of a given size over a given set of - elements, see :func:`itertools.combinations_with_replacement`. + elements, see :func:`itertools.combinations_with_replacement`: - map(Counter, combinations_with_replacement('ABC', 2)) --> AA AB AC BB BC CC + >>> from itertools import combinations_with_replacement + >>> for c in map(Counter, combinations_with_replacement('ABC', 2)): + ... print(c) + ... + Counter({'A': 2}) + Counter({'A': 1, 'B': 1}) + Counter({'A': 1, 'C': 1}) + Counter({'B': 2}) + Counter({'B': 1, 'C': 1}) + Counter({'C': 2}) :class:`deque` objects @@ -464,10 +473,11 @@ elements in the iterable argument. - .. method:: index(x[, start[, end]]) + .. method:: index(x[, start[, stop]]) - Return the position of *x* in the deque. Returns the first match - or raises :exc:`ValueError` if not found. + Return the position of *x* in the deque (at or after index *start* + and before index *stop*). Returns the first match or raises + :exc:`ValueError` if not found. .. versionadded:: 3.5 @@ -493,7 +503,7 @@ .. method:: remove(value) - Removed the first occurrence of *value*. If not found, raises a + Remove the first occurrence of *value*. If not found, raises a :exc:`ValueError`.