commit | 37c0fe56b9053f5f388ba6d6217506a6e73bb819 | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <python@rcn.com> | Fri Apr 15 13:12:21 2011 -0700 |
committer | Raymond Hettinger <python@rcn.com> | Fri Apr 15 13:12:21 2011 -0700 |
tree | 6bfb62f27d7eea8b75d21a8380f25a46376353bd | |
parent | 65c620d0c771e69a7177fc845273000e97dcf472 [diff] [blame] |
Fix minor subclassing issue with collections.Counter
diff --git a/Lib/collections.py b/Lib/collections.py index bb6b15d..cb720ac 100644 --- a/Lib/collections.py +++ b/Lib/collections.py
@@ -516,8 +516,8 @@ 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),)