On Sun, Sep 27, 2020 at 8:49 AM Christopher Barker <python...@gmail.com> wrote: > > > On Fri, Sep 25, 2020 at 11:50 PM Steven D'Aprano <st...@pearwood.info> wrote: > >> > >> 1. We have to pass a sentinel to the setitem dunder if there is no > >> positional index passed. > > > I still don't follow this logic -- why can't nothing be passed? The dunders > either require an index or they don't, would that be just like function > calling? So (adapting the example in the PEP: > > obj[spam=1, eggs=2] > # calls type(obj).__getitem__(obj, spam=1, eggs=2)
Yes, getitem is fine - but look at setitem. ChrisA _______________________________________________ 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/W3K6W2PTOKHNUVHLUGI3BLPGLNM43SNW/ Code of Conduct: http://python.org/psf/codeofconduct/