-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Open
Labels
arrays[a, r, r, a, y, s][a, r, r, a, y, s]
Description
The naming of our multiple index-related functions appears to be inconsistent to me despite recent improvements. In particular, the most generic function returning the natural type of indices for collections is now keys, but the most frequent type of collection in Julia is certainly arrays, for which we use the term "index"/"indices" everywhere else. Then we have eachindex which returns the most efficient type of indices (linear or cartesian depending on array types), and linearindices which always returns linear indices.
linearindices(x)can be deprecated in favor ofLinearIndices(x), which already works, and which is parallel toCartesianIndices(x), which also works.- We could find a more explicit name for
eachindex, likefastindices. - Since
indicesis now deprecated, maybe we could use that term instead ofkeysin 1.0 (not in 0.7). This was indeed proposed in the PR which renamedindicestoaxes. As it's been noted elsewhere, it sounds more acceptable to say that a dict has indices than to say that an array has keys. It's also more consistent withgetindex/setindex. That way we could avoid saying "indices or keys" in the docs (e.g. forfindall) and just say "indices" everywhere.haskeywould have to be changed tohasindex(which could BTW be unified withcheckbounds).
Cc: @andyferris @timholy
yurivish, ararslan, andyferris, tbeason, bramtayl and 2 moreandyferris and ararslan
Metadata
Metadata
Assignees
Labels
arrays[a, r, r, a, y, s][a, r, r, a, y, s]