Commit 78efadb8 authored by Andrew Svetlov's avatar Andrew Svetlov

Update example: Counter.subtract returns None, not self

parent bc453ca8
...@@ -120,6 +120,7 @@ For example:: ...@@ -120,6 +120,7 @@ For example::
>>> c = Counter(a=4, b=2, c=0, d=-2) >>> c = Counter(a=4, b=2, c=0, d=-2)
>>> d = Counter(a=1, b=2, c=3, d=4) >>> d = Counter(a=1, b=2, c=3, d=4)
>>> c.subtract(d) >>> c.subtract(d)
>>> c
Counter({'a': 3, 'b': 0, 'c': -3, 'd': -6}) Counter({'a': 3, 'b': 0, 'c': -3, 'd': -6})
The usual dictionary methods are available for :class:`Counter` objects The usual dictionary methods are available for :class:`Counter` objects
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment