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 -- 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/6IM6CTISEJUCNKHUXBXFAFMI4FQEBGRX/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to