> But what if you wanted to take both positional AND keyword? I was suggesting that that wouldn't be allowed. So subscript either has a single argument, a tuple of arguments, or a dictionary of arguments. Allowing both has some advantages but is less cleanly integratible.
-- Caleb Donovick On Tue, Oct 8, 2019 at 12:16 AM Chris Angelico <ros...@gmail.com> wrote: > On Tue, Oct 8, 2019 at 12:47 PM Caleb Donovick <donov...@cs.stanford.edu> > wrote: > > > > > Why not? > > > > What if I want a getitem that only has keyword arguments? I have to take > the empty tuple as a positional argument, instead of just ensuring that the > key is a dict. > > > > But what if you wanted to take both positional AND keyword?You can't > ensure that the key is both a dict and a tuple. > > Cleaner to continue passing the tuple exactly as normal. > > 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/C4FHJREUQ45D3ULPRLXA4KHMOJEBNHRA/ > 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/MKI3W472CQ5NWNNXADUZDFALHJ6IDM37/ Code of Conduct: http://python.org/psf/codeofconduct/