You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As noted at #26775, we currently allow custom lastindex and firstindex implementations to return non-Int values. For example, Date ranges use an Int64 index, and their last index (and length) cannot always be represented using an Int on 32-bit.
In PR #26775, this required defining lastindex and firstindex in terms of eachindex(IndexLinear(), x) rather than of LinearIndices(x). While it's not really an issue in practice, the fact that LinearIndices is not always able to represent the indices of ranges could be considered as a problem.
Is this really the desired behavior, or should we require that indices be Int?
The text was updated successfully, but these errors were encountered:
This is a little unfortunate, but non-Int indices have always been a bit of a poorly-supported case. We should be able to slowly improve things, but it's not currently possible to reshape large Date ranges on an Int32 machine. Or, equivalently:
We could allow LinearIndices (and CartesianIndices) to be parameterized by the resulting index type, but even then they'll have difficulty doing the ind2sub work they're meant to do because the abstract infrastructure does the index computations in terms of Int. I suppose we could similarly re-implement those methods.
As noted at #26775, we currently allow custom
lastindex
andfirstindex
implementations to return non-Int
values. For example,Date
ranges use anInt64
index, and their last index (and length) cannot always be represented using anInt
on 32-bit.In PR #26775, this required defining
lastindex
andfirstindex
in terms ofeachindex(IndexLinear(), x)
rather than ofLinearIndices(x)
. While it's not really an issue in practice, the fact thatLinearIndices
is not always able to represent the indices of ranges could be considered as a problem.Is this really the desired behavior, or should we require that indices be
Int
?The text was updated successfully, but these errors were encountered: