On Mon, Aug 17, 2020 at 12:32:08AM +1200, Greg Ewing wrote: > On 16/08/20 11:49 am, Guido van Rossum wrote: > > SEMANTICS OF NO ARGUMENTS > > I can see two basic ways of allowing no arguments. One is for the > > interpreter to construct an object that is the argument passed to > > __getitem__ and so forth. The other is to not pass an argument at > > all. I see this as a secondary question. > > If d[] were to be allowed, I would expect it to pass an empty > tuple as the index, since it's the limiting case of reducing the > number of positional indices.
So you would expect `obj[]` and `obj[()]` to be the same? Personally, I think that unless there is an overwhelmingly good use-case for an empty subscript, we should continue to treat empty subscripts (no positional or keyword arguments) as a syntax error. -- Steven _______________________________________________ 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/ZUIDQ5RFJ5XFIZ7AVH4R6VJTZKVES56C/ Code of Conduct: http://python.org/psf/codeofconduct/