What new syntax do you propose? On Thu, Jul 30, 2020 at 5:55 PM Steven D'Aprano <st...@pearwood.info> wrote:
> On Thu, Jul 30, 2020 at 05:03:58PM -0400, Wes Turner wrote: > > > Would these be the *non-mutating* methods desired of insertion-ordered > > dicts? > > > > .iloc[sli:ce] > > .iloc[int] > > .iloc[[list,]] > > .iloc[callable] > > .iloc[bitmask] > > > > .index(key) > > No. > > "iloc" sounds like a new Apple product to keep strangers out of your > home, or maybe something to do with iterators. > > Both slicing and "[list,]" arguments can be easily performed using a > comprehension. > > I have no idea what calling it with a callable or bitmask is intended to > do, or why they would be useful, but bitmasks are usually ints, so how > would it distinguish between the item at index 3 and the item with > bitmask 3? > > Is there a use-case for retrieving the insertion position of a key, or > are we just adding it because we can? > > > -- > Steven > _______________________________________________ > 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/XWQZD45EE6MY2NKV3UYN7GZXYMYZPO2E/ > Code of Conduct: http://python.org/psf/codeofconduct/ >
_______________________________________________ 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/LPG74OMOAWWKO7BBTWUJPIVSNIBNKRRV/ Code of Conduct: http://python.org/psf/codeofconduct/