Import "izip" for different versions of pythonPython
A common idiom that I use for python2Python2-python3Python3 compatibility is:
try:
from itertools import izip
except ImportError: #python3.x
izip = zip
howeverHowever, a comment on one of my stackoverflowStack Overflow answers implies that there may be a better way. Is there a more clean way to accomplish this?
Import "izip" for different versions of python
A common idiom that I use for python2-python3 compatibility is:
try:
from itertools import izip
except ImportError: #python3.x
izip = zip
however, a comment on one of my stackoverflow answers implies that there may be a better way. Is there a more clean way to accomplish this?
Import "izip" for different versions of Python
A common idiom that I use for Python2-Python3 compatibility is:
try:
from itertools import izip
except ImportError: #python3.x
izip = zip
However, a comment on one of my Stack Overflow answers implies that there may be a better way. Is there a more clean way to accomplish this?