py23: alias itertools.izip as 'zip'

so we consistently use python3 zip iterator on both py2 and py3
This commit is contained in:
Cosimo Lupo 2018-06-06 18:21:15 +01:00
parent b38e2bd8ac
commit a84c097c10
No known key found for this signature in database
GPG Key ID: 59D54DB0C9976482

View File

@ -250,7 +250,7 @@ def open(file, mode='r', buffering=-1, encoding=None, errors=None,
file, mode, buffering, encoding, errors, newline, closefd)
# always use iterator for 'range' on both py 2 and 3
# always use iterator for 'range' and 'zip' on both py 2 and 3
try:
range = xrange
except NameError:
@ -259,6 +259,11 @@ except NameError:
def xrange(*args, **kwargs):
raise Py23Error("'xrange' is not defined. Use 'range' instead.")
try:
from itertools import izip as zip
except ImportError:
zip = zip
import math as _math