On Sun, Sep 27, 2020 at 8:49 AM Christopher Barker <[email protected]> wrote: > > > On Fri, Sep 25, 2020 at 11:50 PM Steven D'Aprano <[email protected]> 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 -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/W3K6W2PTOKHNUVHLUGI3BLPGLNM43SNW/ Code of Conduct: http://python.org/psf/codeofconduct/
