-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Closed
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorcorrectness bug ⚠Bugs that are likely to lead to incorrect results in user code without throwingBugs that are likely to lead to incorrect results in user code without throwingiterationInvolves iteration or the iteration protocolInvolves iteration or the iteration protocol
Description
A common idiom in the Python world to partition an iterator into chunks of length N is to turn it into a stateful iterator, then zip it with itself N times.
However, such a Zip iterator in Julia falsely report to have the same length as the original iterator.
Perhaps the takeaway is that stateful iterators cannot be HasLength or HasShape, as it's unknowable if another reference to the iterator iterates it.
Metadata
Metadata
Assignees
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorcorrectness bug ⚠Bugs that are likely to lead to incorrect results in user code without throwingBugs that are likely to lead to incorrect results in user code without throwingiterationInvolves iteration or the iteration protocolInvolves iteration or the iteration protocol