commit | 1c746c28f3cfe798ed4d7b51f50adaa685a4fb0e | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <python@rcn.com> | Fri Apr 15 13:16:46 2011 -0700 |
committer | Raymond Hettinger <python@rcn.com> | Fri Apr 15 13:16:46 2011 -0700 |
tree | 3d49b1db826c930f49a4a3f1fbf1a52d54a91890 | |
parent | 181810b5febf8f5a66a93158500e302f7fff4d1e [diff] [blame] |
Fix minor subclassing issue with collections.Counter
diff --git a/Lib/collections.py b/Lib/collections.py index 27bb5e1..30301ce 100644 --- a/Lib/collections.py +++ b/Lib/collections.py
@@ -459,8 +459,8 @@ self.update(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),)