-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
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
union(a,b) return type should be the same as union(b,a)
#29481
Comments
Union and intersection should probably always return sets. It's almost always the most efficient method, and it would improve consistency. |
For better or for worse, this is pretty much written in stone until 2.0. |
Sure, this can wait til 2.0. In the meantime I'll do a proposed "replacement" in LazyArrays.jl that can be considered for moving into Base when 2.0 development starts.
I assume you mean a subtype of |
Yeah, that's probably true. |
at least it can be specified in the docstrings, something like |
Here's a proposed solution: https://github.com/JuliaArrays/LazyArrays.jl/blob/master/src/lazysetoperations.jl |
This is surprising:
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 lazyUnioned
intermediary that mimicsBroadcasted
. I might make a proof-of-concept in LazyArrays.jl.CC @timholy
The text was updated successfully, but these errors were encountered: