On Fri, Jul 17, 2020 at 11:14:21AM +0100, Jonathan Fine wrote:
> So what should be the new behaviour of:
> >>> d = dict()
> >>> d[x=1, y=2] = 3
TypeError: dict subscripting takes no keyword arguments
Just because something is syntactically allowed doesn't mean it has to
be given a meaning in all circumstances. Just as not all functions
accept keyword arguments:
py> len(x=1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: len() takes no keyword arguments
so not all subscriptable objects will accept keywords.
--
Steven
_______________________________________________
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/6IM6CTISEJUCNKHUXBXFAFMI4FQEBGRX/
Code of Conduct: http://python.org/psf/codeofconduct/