4 ms·
Naw, `zip` is a builtin in py2. You might be thinking of `itertools.izip`? https://repl.it/E5v6/2 https://repl.it/E5v6/2
by mattdeboard 10y ago
Naw, `zip` is a builtin in py2. You might be thinking of `itertools.izip`?
https://repl.it/E5v6/2 https://repl.it/E5v6/2
- Goopplesoft 10y agozip 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.