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
namedtuple
Dict
How about converting Dict() to NamedTuple()?
Dict()
NamedTuple()
julia> dict = Dict(:a => 1) Dict{Symbol, Int64} with 1 entry: :a => 1 julia> using NamedTupleTools julia> NamedTupleTools.namedtuple(dict) (a = 1,) julia> NamedTupleTools.namedtuple(Dict()) ERROR: MethodError: no method matching namedtuple(::Dict{Any, Any}) Closest candidates are: namedtuple(::DataType) at /Users/jinrae/.julia/packages/NamedTupleTools/GZxRn/src/NamedTupleTools.jl:102 namedtuple(::String...) at /Users/jinrae/.julia/packages/NamedTupleTools/GZxRn/src/NamedTupleTools.jl:199 namedtuple(::Tuple{Vararg{Symbol, N}}) where N at /Users/jinrae/.julia/packages/NamedTupleTools/GZxRn/src/NamedTupleTools.jl:196 ... Stacktrace: [1] top-level scope @ REPL[4]:1 julia> (;) NamedTuple() # expected result
The text was updated successfully, but these errors were encountered:
Thank you. I have implemented this for a future (soon) version. I will add it into the current version.
Sorry, something went wrong.
No branches or pull requests
How about converting
Dict()
toNamedTuple()
?The text was updated successfully, but these errors were encountered: