diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2014-07-16 21:18:00 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-07-16 21:18:00 -0400 |
commit | f28aa4eb033fa8f4d9778fed3efc522e1e9d489e (patch) | |
tree | e289adf0f49c98e93270b8aba37813a7d2d63ecd /frozendict/__init__.py | |
parent | cbe369b7a9729eb8bc846e0f8b3369287f4b3985 (diff) |
Fix Python 3 errors
Diffstat (limited to 'frozendict/__init__.py')
-rw-r--r-- | frozendict/__init__.py | 4 |
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 |