On Fri, Jul 17, 2020 at 12:30 PM Christopher Barker <pythonchb@gmail.com> wrote:
On Fri, Jul 17, 2020 at 9:20 AM David Mertz <mertz@gnosis.cx> wrote:
Fwiw, I'm probably -0 on the feature itself. Someone suggested it could be useful for xarray, but I'm not sure now what that would look like. If someone had an example, I could easily be moved.

agreed -- I can imagine the use case, but am not enough of an xarray user to com eup with a compelling example.

But if it IS useful for xarray (and maybe Pandas, and who knows what other nifty packages -- maybe a database wrapper? -- that doesn't mean it has to be used for Mappings.

Jonathan -- I'm still quite confused about what your proposed syntax with dicts means, could you maybe both:

describe it in words

and

Give complete examples -- that is, what the dict looks like before an after the operation, and what is returned.

It seemed clear to me that it would assign some key object key to the supplied value:

>>> 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

It will be interesting to see if my intuition on it lines up with what Jonathan had in mind.