Skip to content

union(a,b) return type should be the same as union(b,a) #29481

@dlfivefifty

Description

@dlfivefifty

This is surprising:

julia> union([1,2,3], Set([4,5,6]))
6-element Array{Int64,1}:
 1
 2
 3
 4
 5
 6

julia> union(Set([4,5,6]), [1,2,3])
Set([4, 2, 3, 5, 6, 1])

In the process of fixing this, I'd propose support more general union types (like Intervals, see JuliaMath/IntervalSets.jl#41) I'd propose redesigning union to use a lazy Unioned intermediary that mimics Broadcasted. I might make a proof-of-concept in LazyArrays.jl.

CC @timholy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions