2 ms·
zip in py2 returns a tuple type (i.e tries to consumes the iterator through a StopIteration) in py3 it returns a iterator (consumes it on demand). Try this in
by Goopplesoft 10y ago
zip in py2 returns a tuple type (i.e tries to consumes the iterator through a StopIteration) in py3 it returns a iterator (consumes it on demand).
Try this in py2: https://repl.it/E5vd/0 https://repl.it/E5vd/0
- deleted 10y ago[deleted]
- mattdeboard 10y agoI'm not near a real REPL, what's the diff? Eager vs. lazy? I think I remember reading something about that change awhile ago.
- reubano 10y agoExactly. Py3 zip is lazy like py2 izip.