diff options
author | Raymond Hettinger <python@rcn.com> | 2011-04-15 20:23:01 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2011-04-15 20:23:01 (GMT) |
commit | b5a40d4d3f5f472fc19ff84e745f150a21391d09 (patch) | |
tree | 1f60a5cf88ad7892866b7226e50c0d3695bf1a9e /Lib/collections | |
parent | 8437fe2708706eb60769c5a68f3371a244123b3e (diff) | |
parent | 6c9e5b779f4cbb16f529f0451a07eaa57caad896 (diff) | |
download | cpython-b5a40d4d3f5f472fc19ff84e745f150a21391d09.zip cpython-b5a40d4d3f5f472fc19ff84e745f150a21391d09.tar.gz cpython-b5a40d4d3f5f472fc19ff84e745f150a21391d09.tar.bz2 |
Fix minor subclassing issue with collections.Counter
Diffstat (limited to 'Lib/collections')
-rw-r--r-- | Lib/collections/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py index 122dfb6..bd19614 100644 --- a/Lib/collections/__init__.py +++ b/Lib/collections/__init__.py @@ -565,8 +565,8 @@ class Counter(dict): self.subtract(kwds) def copy(self): - 'Like dict.copy() but returns a Counter instance instead of a dict.' - return Counter(self) + 'Return a shallow copy.' + return self.__class__(self) def __reduce__(self): return self.__class__, (dict(self),) |