diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-11-26 09:16:25 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-11-26 09:16:25 (GMT) |
commit | 802a484e2482c72a62dc2daeb9dc8e8ebbf1a000 (patch) | |
tree | ff93a5bc941c8cc11acc0f0a17df6404d15e5116 /Lib | |
parent | 5831882c086cab0968e988c8bbe9548ea71b8e7e (diff) | |
download | cpython-802a484e2482c72a62dc2daeb9dc8e8ebbf1a000.zip cpython-802a484e2482c72a62dc2daeb9dc8e8ebbf1a000.tar.gz cpython-802a484e2482c72a62dc2daeb9dc8e8ebbf1a000.tar.bz2 |
tracemalloc: Fix hash methods of Statistic and StatisticDiff
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/tracemalloc.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/tracemalloc.py b/Lib/tracemalloc.py index d51f161..816f734 100644 --- a/Lib/tracemalloc.py +++ b/Lib/tracemalloc.py @@ -39,7 +39,7 @@ class Statistic: self.count = count def __hash__(self): - return (self.traceback, self.size, self.count) + return hash((self.traceback, self.size, self.count)) def __eq__(self, other): return (self.traceback == other.traceback @@ -79,8 +79,8 @@ class StatisticDiff: self.count_diff = count_diff def __hash__(self): - return (self.traceback, self.size, self.size_diff, - self.count, self.count_diff) + return hash((self.traceback, self.size, self.size_diff, + self.count, self.count_diff)) def __eq__(self, other): return (self.traceback == other.traceback @@ -104,7 +104,6 @@ class StatisticDiff: def __repr__(self): return ('<StatisticDiff traceback=%r size=%i (%+i) count=%i (%+i)>' % (self.traceback, self.size, self.size_diff, - self.count, self.count_diff)) def _sort_key(self): |