Gen.jl icon indicating copy to clipboard operation
Gen.jl copied to clipboard

Document disagreement of Base.in and Base.getindex for Selection

Open fsaad opened this issue 3 years ago • 0 comments

For most data structures, in and getindex tend to agree, although this invariant does not hold for selections, where in checks for a full path down the trie, whereas getindex allows specifying a prefix.

using Gen: select
julia > x = select(:y => 1);
julia > :y in x
false
julia > x[:y]
DynamicSelection(Dict{Any, Selection}(1 => AllSelection()))

fsaad avatar Aug 10 '21 18:08 fsaad