summaryrefslogtreecommitdiffstats
path: root/Lib/collections
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2011-04-15 20:23:01 (GMT)
committerRaymond Hettinger <python@rcn.com>2011-04-15 20:23:01 (GMT)
commitb5a40d4d3f5f472fc19ff84e745f150a21391d09 (patch)
tree1f60a5cf88ad7892866b7226e50c0d3695bf1a9e /Lib/collections
parent8437fe2708706eb60769c5a68f3371a244123b3e (diff)
parent6c9e5b779f4cbb16f529f0451a07eaa57caad896 (diff)
downloadcpython-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__.py4
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),)