We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sort
pairs
Dicts
sort doesn't receive the pairs if operating on pairs of Dicts
julia> sort(pairs(cnt), by=x->x.second) ERROR: type Int64 has no field second Stacktrace: [1] getproperty(x::Int64, f::Symbol) @ Base ./Base.jl:33 [2] (::var"#45#46")(x::Int64) @ Main ./REPL[74]:1 [3] lt(o::Base.Order.By{var"#45#46", Base.Order.ForwardOrdering}, a::Int64, b::Int64) @ Base.Order ./ordering.jl:111 [4] lt @ ./ordering.jl:117 [inlined] [5] selectpivot! @ ./sort.jl:557 [inlined] [6] partition!(v::Vector{Int64}, lo::Int64, hi::Int64, o::Base.Order.Perm{Base.Order.By{var"#45#46", Base.Order.ForwardOrdering}, Vector{Int64}}) @ Base.Sort ./sort.jl:579 [7] sort! @ ./sort.jl:600 [inlined] [8] sort!(v::Vector{Int64}, alg::Base.Sort.QuickSortAlg, order::Base.Order.Perm{Base.Order.By{var"#45#46", Base.Order.ForwardOrdering}, Vector{Int64}}) @ Base.Sort ./sort.jl:687 [9] sortperm(v::Vector{Int64}; alg::Base.Sort.QuickSortAlg, lt::Function, by::Function, rev::Nothing, order::Base.Order.ForwardOrdering) @ Base.Sort ./sort.jl:952 [10] sort!(d::OrderedCollections.OrderedDict{Int64, Int64}; byvalue::Bool, args::Base.Iterators.Pairs{Symbol, var"#45#46", Tuple{Symbol}, NamedTuple{(:by,), Tuple{var"#45#46"}}}) @ OrderedCollections ~/.julia/packages/OrderedCollections/cP9uu/src/dict_sorting.jl:12 [11] sort(d::Dict{Int64, Int64}; args::Base.Iterators.Pairs{Symbol, var"#45#46", Tuple{Symbol}, NamedTuple{(:by,), Tuple{var"#45#46"}}}) @ OrderedCollections ./deprecated.jl:72 [12] top-level scope @ REPL[74]:1
where Julia Version 1.6.0 and
julia> eltype(pairs(cnt)) Pair{Int64, Int64} julia> cnt Dict{Int64, Int64} with 80200 entries: 76914 => 41 julia> pairs(cnt) # Dict iterate themselves Dict{Int64, Int64}
The text was updated successfully, but these errors were encountered:
Figured out that it is not Base but caused by type piracy in JuliaCollections/OrderedCollections.jl#25
Base
Sorry, something went wrong.
No branches or pull requests
sort
doesn't receive thepairs
if operating onpairs
ofDicts
where Julia Version 1.6.0 and
The text was updated successfully, but these errors were encountered: