summaryrefslogtreecommitdiffstats
path: root/Lib/tracemalloc.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-11-26 09:16:25 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-11-26 09:16:25 (GMT)
commit802a484e2482c72a62dc2daeb9dc8e8ebbf1a000 (patch)
treeff93a5bc941c8cc11acc0f0a17df6404d15e5116 /Lib/tracemalloc.py
parent5831882c086cab0968e988c8bbe9548ea71b8e7e (diff)
downloadcpython-802a484e2482c72a62dc2daeb9dc8e8ebbf1a000.zip
cpython-802a484e2482c72a62dc2daeb9dc8e8ebbf1a000.tar.gz
cpython-802a484e2482c72a62dc2daeb9dc8e8ebbf1a000.tar.bz2
tracemalloc: Fix hash methods of Statistic and StatisticDiff
Diffstat (limited to 'Lib/tracemalloc.py')
-rw-r--r--Lib/tracemalloc.py7
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):