-
-
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
Replace "key" terminology with "index" terminology #25104
Comments
Just got reminded of this PR when I updated #27749 . If we replace "key" by "index" (or vv), we should also consider "element" vs "value" (e.g. |
I think we can call this "not planned" given the elapsed time and how breaking it would be Nowadays there seems to be convention that indices are for AbstractArrays and keys are for collections where things may have names instead of just numbers |
Our indexing API has a mixture of terminology, such as
getindex
,setindex!
,keys
andhaskey
. This issue suggest simplifying some of this, as a continuation of #25057.Basically, the idea is to replace our "key" terminology with "index" terminology, for consistency and to reduce the number of words used to describe the same thing. After discussion, it seems that "index" makes some sense for arrays and dictionaries, while "key" seems wrong for arrays, so we'd unify these in the direction of "index". We might consider the following:
getindex
getindex
setindex!
setindex!
keys
indices
(in v1.0 not v0.7??)haskey
hasindex
(#25105)keytype
indextype
KeySet
IndexSet
@StefanKarpinski can you please clarify whether prior discussions count as triage or not (i.e. apply the correct label / milestone). In particular, the above table includes a couple extra (obvious) items for consistency. Thanks!
The text was updated successfully, but these errors were encountered: