Re: [Numpy-discussion] Request for comments on PEP 637 - Support for indexing with keyword arguments

2020-09-25 Thread Hameer Abbasi
Hello, For consistency with the current API, I’d suggest an empty tuple. arr[] # arr.__setitem__(()) arr[1] # arr.__setitem__(1) (could be the only exception) arr[1, 2] # arr.__setitem__((1, 2)) # NOT a.__setitem__(1, 2), note the missing parantheses arr[*a, **kw] # arr.__setitem__(a, **kw),

Re: [Numpy-discussion] Request for comments on PEP 637 - Support for indexing with keyword arguments

2020-09-25 Thread Eric Wieser
I agree with Stephan's suggestion of having no default value for positional indices, and letting the user supply it. It seems I replied badly to the mail on the python-ideas list, and my response ended up as a separate thread, at

Re: [Numpy-discussion] Request for comments on PEP 637 - Support for indexing with keyword arguments

2020-09-24 Thread Aaron Meurer
This PEP also opens the possibility of allowing a[] with nothing in the getitem. Has that been considered? Aaron Meurer On Thu, Sep 24, 2020 at 1:48 PM Sebastian Berg wrote: > On Wed, 2020-09-23 at 21:41 -0700, Stephan Hoyer wrote: > > On Wed, Sep 23, 2020 at 2:22 PM Stefano Borini < > >

Re: [Numpy-discussion] Request for comments on PEP 637 - Support for indexing with keyword arguments

2020-09-24 Thread Sebastian Berg
On Wed, 2020-09-23 at 21:41 -0700, Stephan Hoyer wrote: > On Wed, Sep 23, 2020 at 2:22 PM Stefano Borini < > stefano.bor...@gmail.com> > wrote: > > > Hi Stefano -- thanks for pushing this proposal forward! I am sure > that > support for keyword indexing will be very welcome in the scientific >

Re: [Numpy-discussion] Request for comments on PEP 637 - Support for indexing with keyword arguments

2020-09-23 Thread Stephan Hoyer
On Wed, Sep 23, 2020 at 2:22 PM Stefano Borini wrote: > Dear all, > > > > > > I would like to know your opinion on how to address a specific need of > > > the new PEP 637: > > > > > > https://github.com/python/peps/blob/master/pep-0637.txt > > > > > > Such PEP would make a syntax like the

[Numpy-discussion] Request for comments on PEP 637 - Support for indexing with keyword arguments

2020-09-23 Thread Stefano Borini
Dear all, I would like to know your opinion on how to address a specific need of the new PEP 637: https://github.com/python/peps/blob/master/pep-0637.txt Such PEP would make a syntax like the following valid obj[2, x=23] obj[2, 4, x=23] Which would resolve to a call in the form