Thank you all, for your useful contributions. I particularly value the
insight you've given me regarding the experience that underlies your views.
I'll respond to your comments tomorrow.

I am able today to respond to one question. Ricky asked if
   >>> key_object = K(a=1, b=2)  # where K is some new key object type
   >>> d1 = {key_object: 3}
   >>> d2 = {}
   >>> d2[a=1, b=2] = 3
   >>> assert d1==d2
was what I had in mind. The answer is YES, and in some ways better
expressed. (And the new key object type is introduced only if necessary for
the desired user experience.)

The use of dict literals makes the role of the key_object even clearer. For
clarity, when we write
    >>> d[1, 2, 3] = 4
the associated key_object, for backwards compatibility, must be (1, 2, 3),
which is a tuple.

Again for clarity, in today's Python the statements
    >>> d[1, 2, 3] = 4
    >>> d[(1, 2, 3)] = 4
are equivalent. I willingly accept this as a constraint. In my own mind, I
require it.

Once again, thank you all, and I'll say more tomorrow (about 18 hours from
now).
-- 
Jonathan
_______________________________________________
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/UFXWGFAUUQGMA7DBNYAK53THIWQOL632/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to