tc39 / proposal-joint-iteration

a TC39 proposal to synchronise the advancement of multiple iterators
https://tc39.es/proposal-joint-iteration
70 stars 2 forks source link

`fillers` does not need to support providing an iterator #6

Closed bakkot closed 10 months ago

bakkot commented 10 months ago

The first argument to Iterator.zip is either an iterable of iterators or an object whose values are expected to be iterators.

In the former case, fillers (if passed) should be expected to be an iterable of values. Right now step 13.g.ii.1 uses GetIteratorFlattenable, which is for iterator-or-iterables, not iterables. There's no reason to support bare iterators here. It should match the first argument in being an iterable.