On Fri, Jul 17, 2020, 8:16 AM Jonathan Fine <jfine2...@gmail.com> wrote:

> Steve and I have different opinions, as to what the new behaviour of:
>     >>> d = dict()
>     >>> d[x=1, y=2] = 3
> should be.
>
> He prefers that the assignment fail with
>     TypeError: dict subscripting takes no keyword arguments
>
> I prefer that the assignment succeed (and hence a new key-value pair is
> added to 'd').
>

I definitely agree with Steven. It is obviously *possible* to create some
brand new type of object that is "multi-assignment fragment." But why?!

No clearly useful semantics comes to mind for this new object. Well, it
would need to be hashable. Lots of things are though, so it's not like we
have nothing to use as dict keys now.

We don't lose anything if we add the feature but intake don't support it
for dictionaries. If someone comes up with a really useful reason to have
that MultiAssignmentType, is not usually considered a breaking change to go
from "this raises am exception" to "this does something worthwhile" (but
obviously, in all such cases, you can artificially construct code that will
break without a certain exception).
_______________________________________________
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/MUR2S5NGWCNT52Q2HXLEKSVXCVA3RCE6/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to