On Fri, Jul 17, 2020 at 12:30 PM Christopher Barker <python...@gmail.com>
wrote:

> On Fri, Jul 17, 2020 at 9:20 AM David Mertz <me...@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.
_______________________________________________
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/M3I2HXPRRIYNDH7SSZFLPEIM7ZZVMR7Z/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to