[Python-ideas] Re: Adding support for adequately tagging AIX (pep425) to support distributed wheels

2019-10-08 Thread Pradyun Gedam
On Mon, 2 Sep 2019 at 2:24 AM, Michael Felt wrote: > Among other places, Python ideas was recommended as a place to goto. > > In the meantime I have been discussing this on pypa/pip (mainly), and also > on wheel and packaging. Even submitted PRs. But the PRs are only needed if > the tag is

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Chris Angelico
On Wed, Oct 9, 2019 at 10:11 AM David Mertz wrote: >> >> x[foo=:] is x[foo=slice(None, None)] > > > We can combine this with the walrus operator for extra clarity: > > db[o0=o0:=o0==Oo:o0==oO] > > :-) > > Perl isn't dead, it's just resting. Are you sure it isn't dead? I think the correct

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread David Mertz
> > x[foo=:] is x[foo=slice(None, None)] > We can combine this with the walrus operator for extra clarity: db[o0=o0:=o0==Oo:o0==oO] :-) Perl isn't dead, it's just resting. ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Eric V. Smith
On 10/8/2019 4:53 PM, Random832 wrote: On Tue, Oct 8, 2019, at 14:18, Anders Hovmöller wrote: I don't see it. Can you give examples of all the variations of slicing and their keyword equivalent so I understand what you mean? I'll write out the slicing variants and you can fill in how it would

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Eric V. Smith
On 10/8/2019 5:53 PM, Eric V. Smith wrote: On 10/8/2019 4:53 PM, Random832 wrote: On Tue, Oct 8, 2019, at 14:18, Anders Hovmöller wrote: I don't see it. Can you give examples of all the variations of slicing and their keyword equivalent so I understand what you mean? I'll write out the

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Random832
On Tue, Oct 8, 2019, at 14:18, Anders Hovmöller wrote: > I don't see it. Can you give examples of all the variations of slicing > and their keyword equivalent so I understand what you mean? I'll write > out the slicing variants and you can fill in how it would look with > keyword arguments: >

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Random832
On Tue, Oct 8, 2019, at 13:57, Steven D'Aprano wrote: > It is confusing as hell. When I saw this > > da[space=0, time=:2] > > I read it as a slice: > > da[ slice( (space=0, time=), 2, None) ] > > and thought "That must be a typo, because the time keyword > doesn't have a value." Do

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Anders Hovmöller
> On 8 Oct 2019, at 20:49, Todd wrote: > >  >> On Tue, Oct 8, 2019 at 2:18 PM Anders Hovmöller wrote: >> >> On 8 Oct 2019, at 20:07, Todd wrote: >>>  >>> On Tue, Oct 8, 2019 at 1:30 PM Anders Hovmöller wrote: >> On 8 Oct 2019, at 19:19, Caleb

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Todd
On Tue, Oct 8, 2019 at 2:18 PM Anders Hovmöller wrote: > > > On 8 Oct 2019, at 20:07, Todd wrote: > >  > > On Tue, Oct 8, 2019 at 1:30 PM Anders Hovmöller > wrote: > >> >> >> On 8 Oct 2019, at 19:19, Caleb Donovick wrote: >> >>  >> >>> Because >>> >>> >>> dict(foo=:1) >>> File "", line 1

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Todd
On Tue, Oct 8, 2019 at 2:03 PM Steven D'Aprano wrote: > On Tue, Oct 08, 2019 at 12:55:40PM -0400, Todd wrote: > > > > da.isel(space=0, time=slice(None, 2))[...] = spam > > > > > > With this syntax this could be changed to: > > > > > > da[space=0, time=:2] = spam > > > > > Anders: > > > I must

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Anders Hovmöller
> On 8 Oct 2019, at 20:07, Todd wrote: > >  > >> On Tue, Oct 8, 2019 at 1:30 PM Anders Hovmöller wrote: >> >> On 8 Oct 2019, at 19:19, Caleb Donovick wrote: >>>  Because >>> dict(foo=:1) File "", line 1 dict(foo=:1) ^

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Todd
On Tue, Oct 8, 2019 at 1:30 PM Anders Hovmöller wrote: > > > On 8 Oct 2019, at 19:19, Caleb Donovick wrote: > >  > >> Because >> >> >>> dict(foo=:1) >> File "", line 1 >> dict(foo=:1) >> ^ >> SyntaxError: invalid syntax >> > > I don't see how that's an argument, we are

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Todd
On Tue, Oct 8, 2019 at 1:05 PM Anders Hovmöller wrote: > > > On 8 Oct 2019, at 18:59, Todd wrote: > >  > > > On Tue, Oct 8, 2019, 12:46 Anders Hovmöller wrote: > >> >> >> On 8 Oct 2019, at 18:35, Todd wrote: >> >> On Tue, Oct 8, 2019 at 12:22 PM Andrew Barnert via Python-ideas < >>

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Steven D'Aprano
On Tue, Oct 08, 2019 at 12:55:40PM -0400, Todd wrote: > > da.isel(space=0, time=slice(None, 2))[...] = spam > > > > With this syntax this could be changed to: > > > > da[space=0, time=:2] = spam > > Anders: > > I must have missed something... when did the proposal we're discussing > > start

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Kyle Lahnakoski
On 2019-10-07 20:35, Steven D'Aprano wrote: As per Caleb's initial post, this is how Pandas currently does it: db[db['x'] == 1] Replacing that with db[x=1] seems like a HUGE win to me. Even db[{'x': 1}] is pretty clunky. For Pandas, db['x'] which creates an expression involving `x`,

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Anders Hovmöller
> On 8 Oct 2019, at 19:19, Caleb Donovick wrote: > >  >> Because >> >> >>> dict(foo=:1) >> File "", line 1 >> dict(foo=:1) >> ^ >> SyntaxError: invalid syntax > > I don't see how that's an argument, we are talking about a syntax extension. > Slice builder syntax is

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Rhodri James
On 08/10/2019 17:35, Todd wrote: On Tue, Oct 8, 2019 at 12:22 PM Andrew Barnert via Python-ideas < python-ideas@python.org> wrote: On Oct 7, 2019, at 21:21, Caleb Donovick wrote: But what if you wanted to take both positional AND keyword? I was suggesting that that wouldn't be allowed.

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Caleb Donovick
> > Because > > >>> dict(foo=:1) > File "", line 1 > dict(foo=:1) > ^ > SyntaxError: invalid syntax > I don't see how that's an argument, we are talking about a syntax extension. Slice builder syntax is only every allowed in a subscript. Edit my original grammar change

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Anders Hovmöller
> On 8 Oct 2019, at 18:59, Todd wrote: > >  > > >> On Tue, Oct 8, 2019, 12:46 Anders Hovmöller wrote: >> >> >>> On 8 Oct 2019, at 18:35, Todd wrote: >>> On Tue, Oct 8, 2019 at 12:22 PM Andrew Barnert via Python-ideas wrote: On Oct 7, 2019, at 21:21, Caleb Donovick

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Anders Hovmöller
> On 8 Oct 2019, at 18:35, Todd wrote: > > On Tue, Oct 8, 2019 at 12:22 PM Andrew Barnert via Python-ideas > mailto:python-ideas@python.org>> wrote: > On Oct 7, 2019, at 21:21, Caleb Donovick > wrote: > > > > > But what if you wanted to take both positional

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Anders Hovmöller
> On 8 Oct 2019, at 18:27, Todd wrote: > > > On Mon, Oct 7, 2019 at 11:19 AM Anders Hovmöller > wrote: > > >> On 7 Oct 2019, at 16:36, Batuhan Taskaya > > wrote: >> >>  >> In fact, that would be a cool feature for ORMs. IMHO

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Todd
On Tue, Oct 8, 2019 at 12:22 PM Andrew Barnert via Python-ideas < python-ideas@python.org> wrote: > On Oct 7, 2019, at 21:21, Caleb Donovick wrote: > > > > > But what if you wanted to take both positional AND keyword? > > > > I was suggesting that that wouldn't be allowed. So subscript either

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Todd
On Mon, Oct 7, 2019 at 11:19 AM Anders Hovmöller wrote: > > > On 7 Oct 2019, at 16:36, Batuhan Taskaya wrote: > >  > In fact, that would be a cool feature for ORMs. IMHO instead of ugly call > chain with filters, slicing is a better option (on `__class_getattr__`). As > said there are some

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Todd
On Mon, Oct 7, 2019 at 8:37 PM Steven D'Aprano wrote: > On Tue, Oct 08, 2019 at 09:19:07AM +1100, Cameron Simpson wrote: > > On 07Oct2019 10:56, Joao S. O. Bueno wrote: > > >So, in short, your idea is to allow "=" signs inside `[]` get notation > to > > >be translated > > >to dicts on the call,

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Todd
On Mon, Oct 7, 2019 at 8:34 PM Steven D'Aprano wrote: > On Mon, Oct 07, 2019 at 02:22:22PM +0100, Rhodri James wrote: > > On 04/10/2019 20:34, Caleb Donovick wrote: > > > >``` > > >where_x_1 = db[x=1] > > >``` > > which would be equivalent to the existing syntax > >where_x_1 = db[{'x': 1}] >

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Andrew Barnert via Python-ideas
On Oct 7, 2019, at 21:21, Caleb Donovick wrote: > > > But what if you wanted to take both positional AND keyword? > > I was suggesting that that wouldn't be allowed. So subscript either has a > single argument, a tuple of arguments, or a dictionary of arguments. > Allowing both has some

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Dominik Vilsmeier
Caleb Donovick wrote: > > It captures a tiny fraction of Pandas style filtering > > while complicating > > the syntax of Python > > Sure maybe I we can't represent all filters super concisely but at least > inequalities, or any filter on single axis, would not be hard. E.g. > db[x=LT(1)] ==

[Python-ideas] Re: Allow kwargs in __{get|set|del|}item__

2019-10-08 Thread Caleb Donovick
> It captures a tiny fraction of Pandas style filtering while complicating the syntax of Python Sure maybe I we can't represent all filters super concisely but at least inequalities, or any filter on single axis, would not be hard. E.g. db[x=LT(1)] == db[db.x < 1] Granted I don’t really see a