summaryrefslogtreecommitdiff
path: root/frozendict/__init__.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2014-07-16 21:18:00 -0400
committerJason R. Coombs <jaraco@jaraco.com>2014-07-16 21:18:00 -0400
commitf28aa4eb033fa8f4d9778fed3efc522e1e9d489e (patch)
treee289adf0f49c98e93270b8aba37813a7d2d63ecd /frozendict/__init__.py
parentcbe369b7a9729eb8bc846e0f8b3369287f4b3985 (diff)
Fix Python 3 errors
Diffstat (limited to 'frozendict/__init__.py')
-rw-r--r--frozendict/__init__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/frozendict/__init__.py b/frozendict/__init__.py
index 52e6a82..0af9dee 100644
--- a/frozendict/__init__.py
+++ b/frozendict/__init__.py
@@ -1,5 +1,6 @@
import collections
import operator
+import functools
class frozendict(collections.Mapping):
@@ -24,6 +25,7 @@ class frozendict(collections.Mapping):
def __hash__(self):
if self.__hash is None:
- self.__hash = reduce(operator.xor, map(hash, self.iteritems()), 0)
+ hashes = map(hash, self.items())
+ self.__hash = functools.reduce(operator.xor, hashes, 0)
return self.__hash