JuliaCollections / JuliaCollections/DataStructures.jl

Heterogeneous multi dict

Open
#222 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
745
Forks
261
PR merge metrics
No merged PRs in 30d

Description

I can do

Dict(1 => 1, 2=> "two")

but

using DataStructures
MultiDict(1 => 1, 2 => "two")

throws an error:

LoadError: MethodError: no method matching DataStructures.MultiDict{K,V}(::Pair{Int64,Int64}, ::Pair{Int64,String})
Closest candidates are:
  DataStructures.MultiDict{K,V}{K,V}(!Matched::Pair{K,V}...) at /home/jan/.julia/v0.6/DataStructures/src/multi_dict.jl:36
  DataStructures.MultiDict{K,V}(::Any) at /home/jan/.julia/v0.6/DataStructures/src/multi_dict.jl:20
  DataStructures.MultiDict{K,V}{T}(::Any) at sysimg.jl:66
while loading In[27], in expression starting on line 2

is this expected?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the MultiDict constructor in DataStructures/src/multi_dict.jl, especially the method reported at line 36, and compare it with Julia's Dict constructor behavior. Reproduce the heterogeneous Pair example and determine whether MultiDict should accept it; done means the expected constructor behavior is covered and verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.