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
filter(f, keys(::OrderedDict))
Set
I ran into some surprising bugs recently due to this unexpected behaviour:
julia> d = OrderedDict(1 => :a, 2 => :b, 3 => :c); julia> filter(iseven, keys(d)) Set{Int64} with 1 element: 2 julia> filter(isodd, keys(d)) Set{Int64} with 2 elements: 3 1
It seems that the problem is that keys(::OrderedDict)::Base.KeySet. KeySet preserves the order, but filter on the KeySet produces a Base.Set.
keys(::OrderedDict)::Base.KeySet
KeySet
filter
Base.Set
I think this package should have its own KeySet like type with its own dispatches so it acts correctly in the face of things like filter.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I ran into some surprising bugs recently due to this unexpected behaviour:
It seems that the problem is that
keys(::OrderedDict)::Base.KeySet
.KeySet
preserves the order, butfilter
on theKeySet
produces aBase.Set
.I think this package should have its own
KeySet
like type with its own dispatches so it acts correctly in the face of things likefilter
.The text was updated successfully, but these errors were encountered: