Skip to content
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

Closed
andyferris opened this issue Dec 15, 2017 · 2 comments
Closed

Replace "key" terminology with "index" terminology #25104

andyferris opened this issue Dec 15, 2017 · 2 comments
Labels
breaking This change will break code

Comments

@andyferris
Copy link
Member

andyferris commented Dec 15, 2017

Our indexing API has a mixture of terminology, such as getindex, setindex!, keys and haskey. 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:

Current "Index" terminology
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!

@tkluck
Copy link
Contributor

tkluck commented Mar 25, 2019

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. eltype vs valtype). I have no opinion either way, but thought it made sense to record that here.

@brenhinkeller brenhinkeller added the breaking This change will break code label Nov 21, 2022
@brenhinkeller
Copy link
Contributor

brenhinkeller commented Nov 21, 2022

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

@brenhinkeller brenhinkeller closed this as not planned Won't fix, can't repro, duplicate, stale Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This change will break code
Projects
None yet
Development

No branches or pull requests

3 participants