Skip to content

LogicalIndex should not be <: AbstractArray #51071

@rafaqz

Description

@rafaqz

Having AbstractArray around that don't define getindex is problematic for anyone extending the Array interface or dealing with array indexing.

The Julia interface documentation specifies that all arrays need size and getindex. But in practice it seems even getindex is not needed. LogicalIndex not defining getindex also makes it ok to do in the ecosystem, so packages like InvertedIndices.jl do it too.

Really, LogicalIndex is an iterable, but not an AbstractArray, and we should mark that somehow in the type.

I guess this is one for julia 2.0

(or just collect the iterator and take the performance hit)

Metadata

Metadata

Assignees

No one assigned

    Labels

    arrays[a, r, r, a, y, s]

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions