summaryrefslogtreecommitdiffstats
path: root/Doc/library/collections.rst
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2009-01-20 23:44:31 (GMT)
committerRaymond Hettinger <python@rcn.com>2009-01-20 23:44:31 (GMT)
commitb14043c1ec5e8eb25e2e728be64621458891eab3 (patch)
tree968777d2d2d7ecb80384a23dbe259fb4fad34043 /Doc/library/collections.rst
parentc1234036c8b9da503950ffc6cbd2de7682bb0cc9 (diff)
downloadcpython-b14043c1ec5e8eb25e2e728be64621458891eab3.zip
cpython-b14043c1ec5e8eb25e2e728be64621458891eab3.tar.gz
cpython-b14043c1ec5e8eb25e2e728be64621458891eab3.tar.bz2
Beautify and cleanup the references section.
Diffstat (limited to 'Doc/library/collections.rst')
-rw-r--r--Doc/library/collections.rst31
1 files changed, 19 insertions, 12 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
index 1936c30..c231af0 100644
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -282,22 +282,29 @@ are undefined for negative inputs::
>>> e
Counter({'a': 8})
-**References**:
+.. seealso::
-* Wikipedia entry for `Multisets <http://en.wikipedia.org/wiki/Multiset>`_
+ * `Bag class <http://www.gnu.org/software/smalltalk/manual-base/html_node/Bag.html>`_
+ in Smalltalk.
-* `Bag class <http://www.gnu.org/software/smalltalk/manual-base/html_node/Bag.html>`_
- in Smalltalk
-* `C++ multisets <http://www.demo2s.com/Tutorial/Cpp/0380__set-multiset/Catalog0380__set-multiset.htm>`_
- tutorial with standalone examples
+ * An early Python `Bag recipe <http://code.activestate.com/recipes/259174/>`_
+ for Python 2.4 and a `Counter <http://code.activestate.com/recipes/576611/>`_
+ comformant recipe for Python 2.5 and later.
-* An early Python `Bag <http://code.activestate.com/recipes/259174/>`_ recipe
- for Python 2.4 and a `Counter <http://code.activestate.com/recipes/576611/>`_
- comformant recipe for Python 2.5 and later
+ * Wikipedia entry for `Multisets <http://en.wikipedia.org/wiki/Multiset>`_\.
-* 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 <http://www.demo2s.com/Tutorial/Cpp/0380__set-multiset/Catalog0380__set-multiset.htm>`_
+ 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