-
-
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
IndexValue needs better docs #25675
Comments
I believe this was intended, at least originally, as an implementation detail of the |
I think it was implemented to avoid breaking While As an aside, I would also support re-breaking iteration over keyword arguments by making them plain ol' |
I'd absolutely support re-breaking iteration over keyword arguments by restoring them to |
100% agree, seems better to just rip that bandaid off now instead of letting it live in a halfway state. |
See #25711. Regardless of whether this is changed, |
Not strictly true; I think it was introduced to implement |
Why would we ever want them to iterate without returning |
It's really not helpful to keep describing the behavior you don't prefer as "wrong" and "broken". To a python programmer, iterating pairs is "broken" since they're used to iterating keys. Or, as has been pointed out several times, if you call a function like
...and the downtrodden and oppressed will rise, and freedom will ring throughout the land.
This seems like a non-sequitur to me. Sure, we can change named tuples to be implemented with dot overloading. But we can have keywords behave how we want regardless of that. If we want keyword arguments to iterate pairs, we can keep things the way they are, or we can define a new type that's the same as NamedTuple except for iteration behavior. But people like consistency, and it's not ideal to introduce a new kind of thing for each use case instead of re-using functionality. |
Seems to work, and return the largest element as expected: |
Fixed by #25764 (?) |
Not really, since that PR didn't improve the documentation. |
Spent some frustrating time yesterday in Coverage.jl land trying to figure out what this struct is, what it does, and (most importantly) why it exists. I'm sure it's lovely and solves many problems! But a bit more of an explanation of where/why to use it (as opposed to a regular
Dict
?) and how to do some basic ops with it (can Ipush!
to it? how do Iconvert
back and forth to otherAbstractDict
types?) would be great.The text was updated successfully, but these errors were encountered: