-
-
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
Should iteration over Associatives return Pairs #12261
Comments
+10, I feel like this was just a possible oversight in the Pair change, or maybe there was some compatibility reason for it. |
Seems reasonable to me; |
+1 |
+1 Ref #9905 for previous discussion and oversight. |
This is fine but there's an interesting point here regarding covariance. If the eltype of a |
To be a bit more concrete, returning |
I'm not sure what the practical consequences of that would be... |
Not many, but for example |
Ref #12319. We should consider making this change universal for all functions that return key => value pairs. |
Right now we have
I'm proposing this be changed to
i.e. treating dicts as a list of key value pairs for the purposes of iteration. Making them a pair makes clear what the return value means. I think this is a fairly non-breaking change as
Pair
essentially behaves as a 2-element tuple anyway.The text was updated successfully, but these errors were encountered: