From: Raymond Hettinger Date: Tue, 20 Jan 2009 23:42:54 +0000 (+0000) Subject: Beautify and cleanup the references section. X-Git-Tag: v2.7a1~2231 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=acdc84abcf106e4178d18363b899d0f4218008f4;p=python Beautify and cleanup the references section. --- diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index 15754760f5..dc1a70e4b3 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -294,22 +294,29 @@ are undefined for negative inputs:: >>> e Counter({'a': 8}) -**References**: +.. seealso:: -* Wikipedia entry for `Multisets `_ + * `Bag class `_ + in Smalltalk. -* `Bag class `_ - in Smalltalk -* `C++ multisets `_ - tutorial with standalone examples + * An early Python `Bag recipe `_ + for Python 2.4 and a `Counter `_ + comformant recipe for Python 2.5 and later. -* An early Python `Bag `_ recipe - for Python 2.4 and a `Counter `_ - comformant recipe for Python 2.5 and later + * Wikipedia entry for `Multisets `_\. -* Use cases for multisets and mathematical operations on multisets. - Knuth, Donald. The Art of Computer Programming Volume II, - Section 4.6.3, Exercise 19 + * `C++ multisets `_ + tutorial with standalone examples. + + * For use cases for multisets and mathematical operations on multisets, see + *Knuth, Donald. The Art of Computer Programming Volume II, + Section 4.6.3, Exercise 19*\. + + * To enumerate all possible distinct multisets of a given size over a given + set of inputs, see the :func:`combinations_with_replacement` function in + the :ref:`itertools-recipes` for itertools:: + + map(Counter, combinations_with_replacement('abc', 2)) --> AA AB AC BB BC CC :class:`deque` objects