On Tue, Jul 21, 2020, 5:48 AM Gerrit Holl <gerrit.h...@gmail.com> wrote:

> On Sat, 18 Jul 2020 at 18:31, MRAB <pyt...@mrabarnett.plus.com> wrote:
> > [snip]
> > I haven't followed this thread for a while, but, to me, it seems that
> > the simplest option would be to pass the keyword arguments as a dict:
> >
> >      obj[a, b:c, x=1] does obj.__getitem__((a, slice(b, c)), dict(x=1))
> >
> > If there are no keyword arguments, then there's no dict.
>
> Could the entire argument be turned into a namedtuple?
>

The original rejected PEP had some good reasons for not going with a
namedtuple. I haven't read it in a while but I suggest considering them.
The biggest one being, a new class would have to be created and
instantiated for every indexing operation.
_______________________________________________
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/K25KTQ73HFTBCWJF6WOB7OTWCEOVP2UE/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to