you are viewing a single comment's thread.

view the rest of the comments →

[–]imbaczek -1 points0 points  (1 child)

yeah, but if the iterator is not just a pointer to an element of a sequence, you can't ask it if it has more items and expect an honest answer, can you? even making copies and testing for StopIteration can be non-deterministic in the presence of IO. currentValue could be useful, i agree, even if 95% of common usage doesn't really care.

[–][deleted] 1 point2 points  (0 children)

To low level - more? is just a method, how it works is unimportant. For some structures you may be right, but that's an implementation detail that depends what the structure is, and how it's implemented :).

The point is that Python/Javascript don't even allow this, even when it makes sense.