Skip to content

Equality of empty ranges #29421

@sostock

Description

@sostock

In order to be equal, ranges need to have the same first element, last element, and step, even if they are empty. Beside being unintuitive, this also breaks the transitivity of ==:

julia> 2:1 == 1:0
false

julia> 2:1 == Int[] == 1:0
true

Metadata

Metadata

Assignees

No one assigned

    Labels

    arrays[a, r, r, a, y, s]minor changeMarginal behavior change acceptable for a minor releaseneeds decisionA decision on this change is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions