You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My impression was that the old iteration interface should keep on working but throw deprecation warnings. However for OrderedDict this fails:
julia>using DataStructures
julia> od =OrderedDict(:a=>5);
julia>for o in od; end
ERROR: MethodError: no method matching done(::Array{Symbol,1}, ::Int64)
Closest candidates are:done(::DataStructures.TrieIterator, ::Any) at /home/mauro/.julia/packages/DataStructures/hWrs/src/trie.jl:122done(::DataStructures.IntSet, ::Any) at /home/mauro/.julia/packages/DataStructures/hWrs/src/int_set.jl:191done(::DataStructures.EnumerateAll, ::Any) at /home/mauro/.julia/packages/DataStructures/hWrs/src/multi_dict.jl:114...
Stacktrace:
[1] done(::OrderedDict{Symbol,Int64}, ::Int64) at /home/mauro/.julia/packages/DataStructures/hWrs/src/ordered_dict.jl:429
[2] iterate at ./essentials.jl:824 [inlined]
[3] iterate(::OrderedDict{Symbol,Int64}) at ./essentials.jl:828
[4] top-level scope at ./<missing>:0
The deprecation is best effort and only works if the iteration protocol is followed. In this case it is not, because the start function on OrderedDict returns a 1, not a start(::Vector). In any case, I would advise just moving to the new iteration protocol as quickly as possible.
My impression was that the old iteration interface should keep on working but throw deprecation warnings. However for OrderedDict this fails:
due to it calling into the
done
ofVector
: https://github.com/JuliaCollections/DataStructures.jl/blob/a0a289cb158516ef34cda7a123ac87c901da0e87/src/ordered_dict.jl#L429I don't know whether there is anything which can be done about this.
Cc @Keno
(PS: there is no NEWS entry for the new iteration protocol)
The text was updated successfully, but these errors were encountered: