py23: alias itertools.izip as 'zip'
so we consistently use python3 zip iterator on both py2 and py3
This commit is contained in:
parent
b38e2bd8ac
commit
a84c097c10
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user