cactoos icon indicating copy to clipboard operation
cactoos copied to clipboard

toString() implementation for iterators

Open scristalli opened this issue 6 years ago • 2 comments

Iterators (such as Immutable, see #1102) do not have an implementation for toString. It should be decided whether their representation should be the whole collection (as for Iterable), or just a textual representation that does not require traversing the iterator itself.

scristalli avatar May 22 '19 18:05 scristalli

@llorllale/z please, pay attention to this issue

0crat avatar May 22 '19 19:05 0crat

@scristalli good question - if Iterator.toString() prints out all elements, it would consume the iterator itself.

llorllale avatar May 23 '19 23:05 llorllale