What new syntax do you propose?

On Thu, Jul 30, 2020 at 5:55 PM Steven D'Aprano <steve@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)


"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

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?

Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-leave@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/