Guido wrote:
> I think it’s a reasonable idea and encourage you to start working on a
> design for the API and then a PRP.
>
In this post, I explore how the new API might interact with dict objects.
(I think PRP is a typo for PEP.)
Here is an example of the present behaviour
>>> d = dict()
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 mean
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
On Fri, Jul 17, 2020, 6:17 AM Jonathan Fine wrote:
> Guido wrote:
>
>> I think it’s a reasonable idea and encourage you to start working on a
>> design for the API and then a PRP.
>>
>
> In this post, I explore how the new API might interact with dict objects.
> (I think PRP is a typo for PEP.)
>
On Fri, Jul 17, 2020, 8:16 AM Jonathan Fine 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 p
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.
I'm not against the original suggested use with type annotations, but I
also don't really care about it.
On Fri, Jul 17, 2020 at 9:20 AM David Mertz 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 a
On Fri, Jul 17, 2020 at 12:30 PM Christopher Barker
wrote:
> On Fri, Jul 17, 2020 at 9:20 AM David Mertz 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 co
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 n
On Thu, Jul 16, 2020 at 11:52 AM wrote:
> CPython is portable but due to integrated standard library (builtin
> functionality) it is hard to evolve it,
How so? The stdlib is just a collection of packages we happen to ship with
Python. Think of it as if we ship blessed packages from PyPI with Py
On Fri, Jul 17, 2020 at 11:49 AM Jonathan Fine wrote:
> 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
On Fri, Jul 17, 2020, 12:10 David Mertz wrote:
> On Fri, Jul 17, 2020, 8:16 AM Jonathan Fine 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
>> Type
On Fri, Jul 17, 2020 at 12:19 PM David Mertz 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.
>
Here is what it currently looks like to as
On Fri, Jul 17, 2020 at 4:12 PM Todd wrote:
> ds["empty"][lon=1:5, lat=6:] = 10
>
I agree that looks really nice. I think this is the first suggestion to
allow slices on the RHS of keyword indexing. That's the part that was
missing in me understanding how this would help xarray greatly. It's als
On 17/07/2020 21:11, Todd wrote:
On Fri, Jul 17, 2020 at 12:19 PM David Mertz 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.
Here is what
Jonathan and all!
Thanks for picking up on this thread, I almost given up hope that anyone
would be interested. Then it suddenly blew up :)!
Jonathan, your suggestion makes sense as a stop-gap measure for current
Python, but I'm unclear on the way forward to the new syntax:
When you say we
On Fri, Jul 17, 2020 at 11:11:17AM -0400, Ricky Teachey wrote:
> It seems to me that the validity of this key-object paradigm is directly
> tied to the decision of whether or not to change the get/set item dunder
> signatures.
But note that even if we allow keyword args in subscripts, we still
d
On Fri, Jul 17, 2020 at 7:21 PM Steven D'Aprano wrote:
> On Fri, Jul 17, 2020 at 11:11:17AM -0400, Ricky Teachey wrote:
>
> ...
>
> For backwards-compatibility, there will only ever be a single positional
> argument passed into the method. That's because comma-separated values
> in a subscript ar
18 matches
Mail list logo