
June 29, 2020
11:50 a.m.
Tahnk you, On Fri, Jun 26, 2020 at 10:45:07AM -0700, Brett Cannon wrote:
Why can't you do `tuple(dict.items())` to get your indexable pairs?
of course, I can. But how it is expensive/effective? What are the reasons, why object dict.items() is not subscriptable – dict.items()[0]?
Otherwise there are no plans as you would have to introduce a new method as you can't assume e.g. `0` is being used as a dictionary key.
I see. What about to use the items() method – dict.items(1) for the second pair or items(1:3) or … ? H.
…