-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Closed
Labels
iterationInvolves iteration or the iteration protocolInvolves iteration or the iteration protocol
Description
In Julia 1.10, the following code works as expected:
julia> length(Iterators.Stateful([1,2,3]))
3
However, in Julia 1.11rc1, the same code fails with this error message:
MethodError: no method matching length(::Base.Iterators.Stateful{Vector{Int64}, Union{Nothing, Tuple{Int64, Int64}}})
This change in behavior appears to be unintended and breaks existing code that relies on being able to get the length of a Stateful iterator.
Steps to reproduce:
- Install Julia 1.11rc1
- Run the code: length(Iterators.Stateful([1,2,3]))
Expected behavior: Returns 3
Actual behavior: MethodError: no method matching length(::Base.Iterators.Stateful{Vector{Int64}, Union{Nothing, Tuple{Int64, Int64}}})
System information:
- Julia version: 1.11rc1
- OS: Linux Mint 21
- Architecture: x86_64
Metadata
Metadata
Assignees
Labels
iterationInvolves iteration or the iteration protocolInvolves iteration or the iteration protocol