AbstractTrees.jl
AbstractTrees.jl copied to clipboard
Implement children(::AbstractDict) correctly
Previously the children of an AbstractDict
were pair objects, which made printing work but otherwise didn't make a lot of sense. Now that we have functional printing of child keys in print_tree
this can be fixed.
children(dict::AbstractDict)
now returns DictChildren(dict)
, which gives identical results for keys()
, pairs()
, and getindex()
but behaves as a collection identical to values(dict)
. This can also be used for user types.
Currently some tests are not passing because it looks like the current tree traversal implementations expect children
to return something with AbstractVector
-type indices.
@oscardssmith Any thoughts on this?
I think this looks good. That said, it probably would be good to get input from @Keno also.
I believe this doesn't make sense given https://github.com/JuliaCollections/AbstractTrees.jl/pull/96