ASDF.jl
ASDF.jl copied to clipboard
Type piracy?
Aren't
- https://github.com/eschnett/ASDF.jl/blob/b6a05c2710d84e4704c153456ebd7570f60510b1/src/ASDF.jl#L80
- https://github.com/eschnett/ASDF.jl/blob/b6a05c2710d84e4704c153456ebd7570f60510b1/src/ASDF.jl#L84 all acts of type piracy?
E.g.
julia> VersionNumber(Dict("major" => 1, "minor" => 2, "patch" => 3, "prerelease" => nothing, "build" => nothing))
ERROR: MethodError: no method matching VersionNumber(::Dict{String,Union{Nothing, Int64}})
Closest candidates are:
VersionNumber(::UInt32, ::UInt32, ::UInt32, ::Tuple{Vararg{Union{UInt64, String},N} where N}, ::Tuple{Vararg{Union{UInt64, String},N} where N}) at version.jl:33
VersionNumber(::Integer) at version.jl:61
VersionNumber(::Integer, ::Integer) at version.jl:61
...
Stacktrace:
[1] top-level scope at none:0
julia> using ASDF
julia> VersionNumber(Dict("major" => 1, "minor" => 2, "patch" => 3, "prerelease" => nothing, "build" => nothing))
v"1.2.3"
Yes they are...
I assume ASDF should wrap the items it returns into new types. When ASDF writes, it already uses its own types, but when it reads, it directly returns what PyCall produces. It should convert (wrap) these into respective ASDF types.