Can we change:
typealias AttributeDict Dict{UTF8String, Any}
to
typealias AttributeDict Dict{Any, Any}
?
I don't see the point in restricting the keys of the dictionary that is an edge attribute to UTF8String. In fact, why not just construct ExEdge with a Dict()? It seems to unnecessarily complicate things to introduce this AttributeDict type.
UPDATE:
For example, I want to store a tuple attribute to each edge. So I need to do:
attr = AttributeDict()
attr["uc_direction"] = (0, 1, 0)
edge = ExEdge(1, 3, 2, attr)
Oddly, this code:
edge = ExEdge(1, 3, 2, Dict(utf8("uc_direction") => (0, 1, 0)))
throws an error:
ERROR: MethodError: `convert` has no method matching convert(::Type{Graphs.ExEdge{V}}, ::Int64, ::Int64, ::Int64, ::Dict{UTF8String,Tuple{Int64,Int64,Int64}})
This may have arisen from a call to the constructor Graphs.ExEdge{V}(...),
since type constructors fall back to convert methods.
Closest candidates are:
Graphs.ExEdge{V}(::Int64, ::V, ::V, ::Dict{UTF8String,Any})
Graphs.ExEdge{V}(::Int64, ::V, ::V)
call{T}(::Type{T}, ::Any)
...
in call at essentials.jl:57
Can we change:
to
?
I don't see the point in restricting the keys of the dictionary that is an edge attribute to UTF8String. In fact, why not just construct
ExEdgewith aDict()? It seems to unnecessarily complicate things to introduce thisAttributeDicttype.UPDATE:
For example, I want to store a tuple attribute to each edge. So I need to do:
Oddly, this code:
throws an error: