[Python-checkins] cpython (2.7): Update example: Counter.subtract returns None, not self
andrew.svetlov
python-checkins at python.org
Mon Dec 17 13:01:56 CET 2012
http://hg.python.org/cpython/rev/542cfc75c043
changeset: 80901:542cfc75c043
branch: 2.7
parent: 80897:81d1df1f512a
user: Andrew Svetlov <andrew.svetlov at gmail.com>
date: Mon Dec 17 14:01:03 2012 +0200
summary:
Update example: Counter.subtract returns None, not self
files:
Doc/library/collections.rst | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -120,6 +120,7 @@
>>> c = Counter(a=4, b=2, c=0, d=-2)
>>> d = Counter(a=1, b=2, c=3, d=4)
>>> c.subtract(d)
+ >>> c
Counter({'a': 3, 'b': 0, 'c': -3, 'd': -6})
The usual dictionary methods are available for :class:`Counter` objects
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list