summaryrefslogtreecommitdiff
path: root/pokemontools/interval_map.py
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2017-02-13 18:09:31 -0500
committerGitHub <noreply@github.com>2017-02-13 18:09:31 -0500
commit979c98a7c0f67ad6b9685b2d532c66a1f76ffb22 (patch)
treec67cc7b8500aac4e400d4e8bfdbef57a57b63eb1 /pokemontools/interval_map.py
parent74c620d01ad59bfb09cf4111ace549b925fcb9ab (diff)
parent766dea11bd63dee939db2b47198410e6c6e0fc7e (diff)
Merge pull request #103 from eevee/py3
Python 3 compatibility, sort of, maybe
Diffstat (limited to 'pokemontools/interval_map.py')
-rw-r--r--pokemontools/interval_map.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/pokemontools/interval_map.py b/pokemontools/interval_map.py
index daf22cd..fc53e69 100644
--- a/pokemontools/interval_map.py
+++ b/pokemontools/interval_map.py
@@ -1,7 +1,11 @@
# -*- coding: utf-8 -*-
from bisect import bisect_left, bisect_right
-from itertools import izip
+try:
+ from future_builtins import zip
+except ImportError:
+ pass
+
class IntervalMap(object):
"""
@@ -75,7 +79,7 @@ class IntervalMap(object):
((low_bound, high_bound), value)
these items are returned in order"""
previous_bound = None
- for (b, v) in izip(self._bounds, self._items):
+ for (b, v) in zip(self._bounds, self._items):
if v is not None:
yield (previous_bound, b), v
previous_bound = b