
Jan. 8, 2021
5:22 p.m.
On 9/01/21 10:19 am, Ram Rachum wrote:
In short, I want `reversed(itertools.chain(x, y, z))` that behaves like `itertools.chain(map(reversed, (z, y, x)))`.
I think you mean `itertools.chain(*map(reversed, (z, y, x)))` You can get this with itertools.chain(*map(reversed, reversed(t))) Making `reversed(itertools.chain(x, y, z))` do this would be a backwards incompatible change. Also it's hard to see how it could be made to work, because the argument to reversed() necessarily has to be a sequence, not an iterator. -- Greg