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.
>…
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/YP4IEBQTUNFJQQD53BIRDFSWUVG2YPFO/ Code of Conduct: http://python.org/psf/codeofconduct/