Skip to content

Conversation

@Jollywatt
Copy link

@Jollywatt Jollywatt commented Mar 14, 2022

This minimal PR allows keys(od)[i] and values(od)[j] instead of the equivalent od.keys[i] and od.vals[j], where od isa OrderedDict.

I often find myself expecting keys(od) and values(od) to be indexable, preferring this over accessing od.keys and od.vals, since the latter seems like an implementation detail. Perhaps there is a deliberate design choice against this?

Enabling `keys(od)[i]` and `values(od)[j]` instead of
the equivalent `od.keys[i]` and `od.vals[j]`.
@oxinabox
Copy link
Member

I like this idea.
But it might be too inconsistent with other AbstractDicts.

What do you think @timholy ?

@Jollywatt Jollywatt closed this Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants