-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
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
Seeking advice: SortedDict constructors #781
Comments
Yes, that would be OK. We do that in a few places I think. |
Merged
Closed via #787 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right now I'm making major revisions to the sorted containers to address several open issues. Here is an issue that I was not planning to address but have stumbled across. The file https://github.com/JuliaCollections/DataStructures.jl/blob/master/src/sorted_dict.jl starts off with a complex sequence of constructors. I'm having trouble understanding the code that attempts to deduce types, and in any case it doesn't work as well as Dict. For example:
I'm wondering: would it be OK for the constructor
SortedDict(kv::Any)
to passkv
tocollect
, and then build the SortedDict from the resulting Vector? The functioncollect
, likeDict
, excels at deducing types. The disadvantage is that it is inefficient to copy the data twice, but the documentation can state that the constructorSortedDict{K,V}(kv)
is preferred overSortedDict(kv)
.The text was updated successfully, but these errors were encountered: