-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
RFC: Rename Associative to AbstractDict
#25012
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
Conversation
|
From math background, I always thought |
|
I was uncomfortable with the unclarity that an |
|
Oh, for the record, there isn't a prototypical concrete |
|
I really like @rfourquet’s suggestion, which would allow the type hierarchy in DataStructures.jl to be filled out properly. Right now, neither |
|
Yes, having an However, I'd point out that (a) adding an immediate supertype to
lol, my bad. |
|
I'm fine with either renaming |
1e84614 to
9aa96b9
Compare
|
Can I request that triage please discuss whether to include My point of view is that adding things with no concrete types (or even defined interface) is not going to be helpful to many people, and that adding a supertype in later when we know exactly how that helps would be a better approach. A deprecation in v0.7 marks a fresh start - my worry is that without this, there may be code out there that expects e.g. unique keys from |
|
Doing a simple rename for now is the better approach. I am a one-man triage team 👅 |
9aa96b9 to
89d788d
Compare
I mentioned this at the "API consistency review" issue #20402 (comment). I wanted to see how this one would play out - it wasn't too hard in the end.
Some of the reasons I think this is worthwhile:
AbstractArray,AbstractSet,AbstractRangeandAbstractStringwith prototypical concrete typesArray,Set,,RangeString. It seems consistent to also haveAbstractDictandDict. EDIT:Rangewas recently renamedAbstractRange, in the name of consistency.Associativeis a bit of a unique case - all concrete implementations are namedDict,SortedDict,WeakKeyDict- and I haven't seen aSortedAssociativeorImmutableAssociativein the wild (someone please correct me if I'm wrong).FootoAbstractFooand back again. They should be able to guess that aDictis anAbstractDict, when they first come acrossAbstractDictin a function signature. They will have one less word to learn!Associativewas. It's quite possible that many new users with a non-computer-science background don't recognize the term "associative array" (I hadn't, before Julia - I did know of maps, dictionaries, hash tables... even "a functional relation of two-tuples"... so I wasn't completely naive).Associativeis an adjective. Types in Julia are usually nouns. (OK, OK, but we have had bikesheddings over less). The wordAssociation(used by at least Mathematica) would be seem more correct thanAssociative(though I wouldn't recommend that change overAbstractDict).(Apart from the bikeshedding issues, this also implicitly touches on some dicussions about the "meaning" of
Associativecollections, because generally ourAbstractFoo/Foopairs behave quite similarly. In particular, refer to comments like this and the second point in this (the basic summary is: should theAssociativeinterface allow or disallow multi-maps, etc, which are a generalized kind of associative container - my position is that it is very useful to know that the "dictionary" interface guarantees that the keys appear only once in the collection, and that other abstract types or data structures could and should be used to model multi-maps instead))The changes in this PR are purely cosmetic (no change in functionality).