In particular, we should specify and document what exactly zip does when its first child terminates. Currently, as soon as self.a.next() returns None, it short-circuits execution without calling self.b.next(). This could lead to some potential surprising behavior:
self.a 1 2 3 5 6
self.b 1 2 3 4 5 6
------
self 11 22 33 54 65
To be clear, I'm not saying this behavior is bad; just that it should be more explicitly documented. This will allow developers to more confidently build abstractions on top of Zip, knowing exactly what it does with the underlying iterator.
In particular, we should specify and document what exactly zip does when its first child terminates. Currently, as soon as
self.a.next()returns None, it short-circuits execution without callingself.b.next(). This could lead to some potential surprising behavior:To be clear, I'm not saying this behavior is bad; just that it should be more explicitly documented. This will allow developers to more confidently build abstractions on top of Zip, knowing exactly what it does with the underlying iterator.