[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-09-02 Thread Ricky Teachey
On Wed, Sep 2, 2020, 12:19 AM Christopher Barker wrote: > I may get a chance to look carefully at this in a bit, but for now: > > On Tue, Sep 1, 2020 at 6:38 PM Ricky Teachey wrote: > >> Sorry for all the replies but I'm honestly very unsure how do this >> correctly under Steven's proposal. >>

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-09-02 Thread Stefano Borini
On Wed, 2 Sep 2020 at 05:20, Christopher Barker wrote: > And, in fact, the current sytax is pretty tricky as well. Say you want to > make a class that takes multiple indices -- like a Mtraix, for instance. > > your __getitem__ looks like: > > def __getitem__(self, index): > > as they all do. But

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-09-01 Thread Christopher Barker
I may get a chance to look carefully at this in a bit, but for now: On Tue, Sep 1, 2020 at 6:38 PM Ricky Teachey wrote: > Sorry for all the replies but I'm honestly very unsure how do this > correctly under Steven's proposal. > That's OK. It's going to be tricky, and keeping backward

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-09-01 Thread Random832
On Tue, Sep 1, 2020, at 21:06, Ricky Teachey wrote: > Here's my attempt, it is probably lacking. I'm five years into a > self-taught venture in python... If I can't get this right the first > time, it worries me a little. > > > MISSING=object() > > def __getitem__(self, key=MISSING,

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-09-01 Thread Brendan Barnwell
On 2020-09-01 07:24, Steven D'Aprano wrote: Operator overloading is a thing, so if you want `a + b` to mean looking up a database for `a` and writing it to file `b`, you can. But the blessed use-cases for the `+` operator are numeric addition and sequence concatenation. Anything else is an

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-09-01 Thread Ricky Teachey
On Tue, Sep 1, 2020, 9:20 PM Ricky Teachey wrote: > On Tue, Sep 1, 2020, 9:06 PM Ricky Teachey wrote: > >> On Tue, Sep 1, 2020, 8:35 PM Guido van Rossum wrote: >> >>> On Tue, Sep 1, 2020 at 4:57 PM Greg Ewing >>> wrote: >>> On 2/09/20 2:24 am, Steven D'Aprano wrote: > On Sun, Aug

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-09-01 Thread Ricky Teachey
On Tue, Sep 1, 2020, 9:06 PM Ricky Teachey wrote: > On Tue, Sep 1, 2020, 8:35 PM Guido van Rossum wrote: > >> On Tue, Sep 1, 2020 at 4:57 PM Greg Ewing >> wrote: >> >>> On 2/09/20 2:24 am, Steven D'Aprano wrote: >>> > On Sun, Aug 30, 2020 at 05:49:50PM +1200, Greg Ewing wrote: >>> >> On

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-09-01 Thread Ricky Teachey
On Tue, Sep 1, 2020, 8:35 PM Guido van Rossum wrote: > On Tue, Sep 1, 2020 at 4:57 PM Greg Ewing > wrote: > >> On 2/09/20 2:24 am, Steven D'Aprano wrote: >> > On Sun, Aug 30, 2020 at 05:49:50PM +1200, Greg Ewing wrote: >> >> On 30/08/20 3:06 pm, Steven D'Aprano wrote: >> >>> On Thu, Aug 27,

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-09-01 Thread Guido van Rossum
On Tue, Sep 1, 2020 at 4:57 PM Greg Ewing wrote: > On 2/09/20 2:24 am, Steven D'Aprano wrote: > > On Sun, Aug 30, 2020 at 05:49:50PM +1200, Greg Ewing wrote: > >> On 30/08/20 3:06 pm, Steven D'Aprano wrote: > >>> On Thu, Aug 27, 2020 at 11:13:38PM +1200, Greg Ewing wrote: > >>> > a[17,

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-09-01 Thread Greg Ewing
On 2/09/20 2:24 am, Steven D'Aprano wrote: On Sun, Aug 30, 2020 at 05:49:50PM +1200, Greg Ewing wrote: On 30/08/20 3:06 pm, Steven D'Aprano wrote: On Thu, Aug 27, 2020 at 11:13:38PM +1200, Greg Ewing wrote: a[17, 42] a[time = 17, money = 42] a[money = 42, time = 17] > Compares

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-09-01 Thread Christopher Barker
very related to this conversation -- isn't the use of [] for indexing and its use in Type hinting functionally very different as well? -CHB On Tue, Sep 1, 2020 at 9:55 AM David Mertz wrote: > > On 30/08/20 3:06 pm, Steven D'Aprano wrote: > >> (There are a few gray areas, such as

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-09-01 Thread David Mertz
> On 30/08/20 3:06 pm, Steven D'Aprano wrote: > (There are a few gray areas, such as array/matrix/vector addition, which > sneak into the "acceptable" area by virtue of their long usage in > mathematics.) > >>> a / b/ c 0.01 >>> home / 'git' / 'pip'

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-09-01 Thread Steven D'Aprano
On Sun, Aug 30, 2020 at 05:49:50PM +1200, Greg Ewing wrote: > On 30/08/20 3:06 pm, Steven D'Aprano wrote: > >On Thu, Aug 27, 2020 at 11:13:38PM +1200, Greg Ewing wrote: > > > >>a[17, 42] > >>a[time = 17, money = 42] > >>a[money = 42, time = 17] > > > >I don't think that something like

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-09-01 Thread Ricky Teachey
On Sun, Aug 30, 2020 at 6:19 PM Stefano Borini wrote: > 2. pandas has this exact problem with column names, and while they > have a workaround, in my opinion it is suboptimal > What is the workaround? --- Ricky. "I've never met a Kentucky man who wasn't

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-30 Thread Stefano Borini
On Sun, 30 Aug 2020 at 04:09, Steven D'Aprano wrote: > > Nobody disputes that it *could* be made to work that way. But I'm > > not convinced that it's the *best* way for it to work. The killer > > argument in my mind is what you would have to do to make an object > > where all of the following

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-29 Thread Greg Ewing
On 30/08/20 3:06 pm, Steven D'Aprano wrote: On Thu, Aug 27, 2020 at 11:13:38PM +1200, Greg Ewing wrote: a[17, 42] a[time = 17, money = 42] a[money = 42, time = 17] I don't think that something like that is exactly the intended use-case for the feature, I don't see why we need

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-29 Thread Steven D'Aprano
On Thu, Aug 27, 2020 at 11:13:38PM +1200, Greg Ewing wrote: > >So if you want to accept keywords, you just add keywords to your > >existing dunder method. If you don't want them, don't add them. We don't > >need a new dunder just for the sake of keywords. > > Nobody disputes that it *could* be

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-27 Thread Greg Ewing
On 27/08/20 3:56 pm, Steven D'Aprano wrote: On Thu, Aug 27, 2020 at 03:28:07AM +1200, Greg Ewing wrote: > We're falling back to __getitem__ here, which doesn't currently allow keywords, Point of order: **the getitem dunder** already allows keywords, and always has, and always will. It's just

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-26 Thread Todd
On Thu, Aug 27, 2020, 00:56 Bruce Leban wrote: > A bunch of the conversation here is how to handle both positional and > keyword arguments with a single signature. Let me suggest an alternative. > At compile time, we know if the call is made with keyword arguments or not. > > a[1]

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-26 Thread Bruce Leban
A bunch of the conversation here is how to handle both positional and keyword arguments with a single signature. Let me suggest an alternative. At compile time, we know if the call is made with keyword arguments or not. a[1] positional only a[b=1] keyword only a[1, b=1]both

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-26 Thread Steven D'Aprano
On Thu, Aug 27, 2020 at 03:28:07AM +1200, Greg Ewing wrote: > On 27/08/20 12:53 am, Steven D'Aprano wrote: > > >Presumably the below method is provided by `object`. If not, what > >provides it? > > > >> def __getindex__(self, *args, **kwds): > >> if kwds: > >> raise

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-26 Thread Ricky Teachey
On Wed, Aug 26, 2020 at 9:00 PM Greg Ewing wrote: > On 27/08/20 3:51 am, Ricky Teachey wrote: > > On Wed, Aug 26, 2020 at 11:30 AM Greg Ewing > > wrote: > > > > No, it would be done by checking type slots, no MRO search involved. > > > > Can you elaborate

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-26 Thread Greg Ewing
On 27/08/20 3:51 am, Ricky Teachey wrote: On Wed, Aug 26, 2020 at 11:30 AM Greg Ewing > wrote: No, it would be done by checking type slots, no MRO search involved. Can you elaborate on this for my understanding? For frequently-used special methods such

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-26 Thread Ricky Teachey
On Wed, Aug 26, 2020 at 11:30 AM Greg Ewing wrote: > On 27/08/20 12:53 am, Steven D'Aprano wrote: > > > This is going to slow down the most common cases of subscripting: the > > interpreter has to follow the entire MRO to find `__getindex__` in > > object, which then dispatches to the

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-26 Thread Greg Ewing
On 27/08/20 12:53 am, Steven D'Aprano wrote: Presumably the below method is provided by `object`. If not, what provides it? def __getindex__(self, *args, **kwds): if kwds: raise TypeError("Object does not support keyword indexes") if not args:

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-26 Thread Ricky Teachey
On Wed, Aug 26, 2020 at 9:48 AM Steven D'Aprano wrote: > Demonstration: > > > py> class Dynamic: > ... def __getitem__(self, arg): > ... print("original") > ... type(self).__getitem__ = lambda *args: > print("replaced") > ... > py> > py> x

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-26 Thread Steven D'Aprano
On Tue, Aug 25, 2020 at 10:51:42PM -0400, Ricky Teachey wrote: > > The only way it could tell that would be to inspect *at runtime* the > > `__setitem__` method. And it would have to do this on every subscript > > call. Introspection is likely to be slow, possibly very slow. This would > > make

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-26 Thread Steven D'Aprano
On Wed, Aug 26, 2020 at 03:06:25PM +1200, Greg Ewing wrote: > On 26/08/20 1:59 pm, Steven D'Aprano wrote: > >Most existing uses of subscripts already don't fit that key:value > >mapping idea, starting with lists and tuples. > > Not sure what you mean by that. Lists and tuples aren't key:value

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-25 Thread Greg Ewing
On 26/08/20 1:59 pm, Steven D'Aprano wrote: Most existing uses of subscripts already don't fit that key:value mapping idea, starting with lists and tuples. Not sure what you mean by that. Given `obj[spam]`, how does the interpreter know whether to call `__getitem__` or `__getindex__`? What

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-25 Thread Ricky Teachey
On Tue, Aug 25, 2020 at 9:50 PM Steven D'Aprano wrote: > On Mon, Aug 24, 2020 at 01:10:26PM -0400, Ricky Teachey wrote: > SIGNATURE === SEMANTICS > > (self, a, b) === (self, key_tuple, value) > > > > In the above, a on the left side, semantically, is the key tuple, and b > in > > the value on

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-25 Thread Steven D'Aprano
On Wed, Aug 26, 2020 at 11:31:25AM +1200, Greg Ewing wrote: > I think an argument can be made that the new dunder -- let's call > it __getindex__ for now -- shouldn't be considered part of the > mapping protocol. It's a new thing for classes that want to use the > indexing notation in ways that

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-25 Thread Steven D'Aprano
On Mon, Aug 24, 2020 at 01:10:26PM -0400, Ricky Teachey wrote: > SIGNATURE === SEMANTICS > (self, a, b) === (self, key_tuple, value) > > In the above, a on the left side, semantically, is the key tuple, and b in > the value on the RHS. That's not how Python works today. Individual values

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-25 Thread Todd
On Tue, Aug 25, 2020 at 4:41 PM Stefano Borini wrote: > On Sat, 8 Aug 2020 at 02:34, Stephan Hoyer wrote: > > > I'm sorry, I did a poor job of editing this. > > > > To fill in my missing word: From my perspective, the *only* reasonable > way to add keyword arguments to indexing would be in a

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-25 Thread Steven D'Aprano
On Fri, Aug 07, 2020 at 06:31:02PM -0700, Stephan Hoyer wrote: > To fill in my missing word: From my perspective, the *only* reasonable way > to add keyword arguments to indexing would be in a completely backwards > compatible way with **kwargs. Do you have a reason for this assertion? I see no

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-25 Thread Ricky Teachey
On Tue, Aug 25, 2020, 7:35 PM Greg Ewing wrote: > On 26/08/20 10:03 am, Stefano Borini wrote: > > But you have a point that whatever the implementation might be, it has > > to play nice with the current dict() behavior. Yet, if we were to add > > an enhanced dunder, nothing for the current dict

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-25 Thread Steven D'Aprano
On Tue, Aug 25, 2020 at 09:23:18PM +0100, Stefano Borini wrote: > There's another option (but I am not endorsing it): > > a[1:2, 2, j=4:7, k=3] means: > > a.__getitem__((slice(1, 2, None), 2, named("j", slice(4, 7, None)), > named("k", 3)})) This is not another option, it's just a variant on

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-25 Thread Greg Ewing
On 26/08/20 10:03 am, Stefano Borini wrote: But you have a point that whatever the implementation might be, it has to play nice with the current dict() behavior. Yet, if we were to add an enhanced dunder, nothing for the current dict would change. Despite arguing against it earlier, I think

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-25 Thread Stefano Borini
On Tue, 25 Aug 2020 at 22:42, Ricky Teachey wrote: > Actually I think this *may not* be true. Consider, if we were starting at > zero ,and we agreed we wanted dict literal behavior to work like the > following: > > >>> idx1 = 1,2,3 > >>> idx2 = 1,2 > >>> idx3 = 1 > >>> d = {idx1: "foo", idx2:

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-25 Thread Ricky Teachey
On Tue, Aug 25, 2020 at 4:26 PM Stefano Borini wrote: > In any case, I think that Ricky Teachey might be onto something. > Well when it comes to python ideas, that actually might be a first for me. ;) > Imagine we start from zero. There's no __getitem__. How would you > envision it to work? >

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-25 Thread Stefano Borini
On Sat, 8 Aug 2020 at 02:34, Stephan Hoyer wrote: > I'm sorry, I did a poor job of editing this. > > To fill in my missing word: From my perspective, the *only* reasonable way to > add keyword arguments to indexing would be in a completely backwards > compatible way with **kwargs. Let me

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-25 Thread Stefano Borini
There's another option (but I am not endorsing it): a[1:2, 2, j=4:7, k=3] means: a.__getitem__((slice(1, 2, None), 2, named("j", slice(4, 7, None)), named("k", 3)})) Where named is an object kind like slice, and it evaluates to the pure value, but also has a .name like slice() has .start. In

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-25 Thread Ricky Teachey
On Tue, Aug 25, 2020, 2:09 AM Christopher Barker wrote: > On Mon, Aug 24, 2020 at 11:10 AM Ricky Teachey wrote: > >> \The interpreter wouldn't. I'm talking about adding this knowledge of >> signature dependent semantics to `type`. >> >> To implement this, under the hood `type` would detect the

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-25 Thread Christopher Barker
On Mon, Aug 24, 2020 at 11:10 AM Ricky Teachey wrote: > \The interpreter wouldn't. I'm talking about adding this knowledge of > signature dependent semantics to `type`. > > To implement this, under the hood `type` would detect the signatures with > different semantics, and choose to wrap the

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-24 Thread Ricky Teachey
Here is an illustration of what I am talking about: sigdepsem: Signature Dependent Semantics --- Ricky. "I've never met a Kentucky man who wasn't either thinking about going home or actually going home." - Happy Chandler On Mon, Aug 24, 2020 at 2:10 PM

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-24 Thread Ricky Teachey
On Mon, Aug 24, 2020 at 1:52 PM Christopher Barker wrote: > I’m not at all sure this Idea is possible, > > But even if so, there’s a real trick here. The [] operator is not a > function call, it is a special operator that “takes” a single expression. > > Thing[a, b] is not “getting” two

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-24 Thread Christopher Barker
I’m not at all sure this Idea is possible, But even if so, there’s a real trick here. The [] operator is not a function call, it is a special operator that “takes” a single expression. Thing[a, b] is not “getting” two objects, it is getting a single tuple, which is created by the comma. That

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-24 Thread Ricky Teachey
Here is another way forward-- inspired by a conversation off-list with Jonathan Fine. I am calling it "signature dependent semantics". Right now, the semantic meaning of a __setitem__ function like this: # using ambiguous names for the parameters on purpose def __setitem__ (self, a, b): ...

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-23 Thread Steven D'Aprano
On Sun, Aug 23, 2020 at 03:47:59PM +0100, Stefano Borini wrote: > I am currently in the process of scouting the whole set of threads and > rewrite PEP-472, somehow. > but just as a 2 cents to the discussion, the initial idea was focused > on one thing only: give names to axes. That is one of the

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-23 Thread Ricky Teachey
On Sun, Aug 23, 2020 at 10:48 AM Stefano Borini wrote: > When you have a getitem operation, you are acting on a set of axes. > e.g. a[4,5,6] acts on three axes. The first axis index is 4, the > second is 5 and the third is 6. > These axes currently are anonymous, but the whole idea is that a

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-23 Thread Stefano Borini
On Sat, 8 Aug 2020 at 05:12, Ricky Teachey wrote: > The semantic meaning of m[1, 2, a=3, b=2] might be made to mean: > > 5.m.__getx__(1, 2, a=3, b=4) > > ...which would in turn call, by default: > > m.__getitem__((1, 2), a=3, b=4) I am currently in the process of scouting the whole set of

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-08 Thread Ricky Teachey
I misunderstood thanks for the clarification and if an apology is appropriate I gladly offer mine. On Sat, Aug 8, 2020, 9:01 PM Edwin Zimmerman wrote: > On 8/7/2020 10:47 PM, Ricky Teachey wrote: > > On Fri, Aug 7, 2020 at 9:25 PM Edwin Zimmerman > wrote: > >> On 8/7/2020 8:28 PM, Greg Ewing

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-08 Thread Edwin Zimmerman
On 8/7/2020 10:47 PM, Ricky Teachey wrote: > On Fri, Aug 7, 2020 at 9:25 PM Edwin Zimmerman > wrote: > > On 8/7/2020 8:28 PM, Greg Ewing wrote: > >  I don't think anyone has the appetite for a Python 4 any > > time soon. > > > I'm included in

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-07 Thread Ricky Teachey
On Fri, Aug 7, 2020 at 10:47 PM Steven D'Aprano wrote: > On Fri, Aug 07, 2020 at 12:09:28PM -0400, Ricky Teachey wrote: > > > I was actually trying to help the kwd arg case here. As illustrated by > the > > quote I included from Greg Ewing, there seems to be not even close to a > > consensus

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-07 Thread Ricky Teachey
On Fri, Aug 7, 2020 at 9:25 PM Edwin Zimmerman wrote: > On 8/7/2020 8:28 PM, Greg Ewing wrote: > > I don't think anyone has the appetite for a Python 4 any > > time soon. > > > I'm included in "anyone" here. From reading this list, it seems to me > that "Python 4" is invoked as some folks

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-07 Thread Steven D'Aprano
On Fri, Aug 07, 2020 at 12:09:28PM -0400, Ricky Teachey wrote: > I was actually trying to help the kwd arg case here. As illustrated by the > quote I included from Greg Ewing, there seems to be not even close to a > consensus over what the semantic meaning of this should be: > > m[1, 2, a=3,

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-07 Thread Stephan Hoyer
On Fri, Aug 7, 2020 at 6:29 PM Stephan Hoyer wrote: > On Fri, Aug 7, 2020 at 9:12 AM Ricky Teachey wrote: > >> On Fri, Aug 7, 2020 at 4:19 AM Steven D'Aprano >> wrote: >> >>> On Fri, Aug 07, 2020 at 05:54:18PM +1000, Steven D'Aprano wrote: >>> >>> > This proposal doesn't say anything about

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-07 Thread Stephan Hoyer
On Fri, Aug 7, 2020 at 9:12 AM Ricky Teachey wrote: > On Fri, Aug 7, 2020 at 4:19 AM Steven D'Aprano > wrote: > >> On Fri, Aug 07, 2020 at 05:54:18PM +1000, Steven D'Aprano wrote: >> >> > This proposal doesn't say anything about reversing the decision made >> all >> > those years ago to bundle

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-07 Thread Edwin Zimmerman
On 8/7/2020 8:28 PM, Greg Ewing wrote: >  I don't think anyone has the appetite for a Python 4 any > time soon. > I'm included in "anyone" here.  From reading this list, it seems to me that "Python 4" is invoked as some folks favorite magical justification for proposing major breaking changes. 

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-07 Thread Greg Ewing
On 8/08/20 4:09 am, Ricky Teachey wrote: If that incongruity were to be fixed, it seems to me it would become *obvious* that the semantic meaning of ` m[1, 2, a=3, b=2]` should definitely be: m.__get__(1, 2, a=3, b=4) It would certainly achieve that goal. The question is whether it would be

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-07 Thread Ricky Teachey
On Fri, Aug 7, 2020 at 4:19 AM Steven D'Aprano wrote: > On Fri, Aug 07, 2020 at 05:54:18PM +1000, Steven D'Aprano wrote: > > > This proposal doesn't say anything about reversing the decision made all > > those years ago to bundle all positional arguments in a subscript into a > > single

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-07 Thread Steven D'Aprano
On Fri, Aug 07, 2020 at 05:54:18PM +1000, Steven D'Aprano wrote: > This proposal doesn't say anything about reversing the decision made all > those years ago to bundle all positional arguments in a subscript into a > single positional parameter. What's done is done, that's not going to >

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-07 Thread Steven D'Aprano
On Tue, Aug 04, 2020 at 10:58:51AM -0400, Todd wrote: > My main issue with this is that, in my opinion, dunders are not something a > beginner should be messing with anyway. By the time someone is experienced > enough to start working on this, they are also experienced enough to > understand

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-05 Thread Todd
On Wed, Aug 5, 2020, 10:38 <2qdxy4rzwzuui...@potatochowder.com> wrote: > On 2020-08-04 at 10:58:51 -0400, > Todd wrote: > > > My main issue with this is that, in my opinion, dunders are not > > something a beginner should be messing with anyway. By the time > > someone is experienced enough to

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-05 Thread Todd
On Wed, Aug 5, 2020, 09:47 Ricky Teachey wrote: > Hi Todd thanks for your response. > > On Tue, Aug 4, 2020 at 11:01 AM Todd wrote: > >> On Tue, Aug 4, 2020 at 8:17 AM Ricky Teachey wrote: >> >>> ... >>> >>> There could be several reasons for changing the item dunder signatures. >>> The

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-05 Thread 2QdxY4RzWzUUiLuE
On 2020-08-04 at 10:58:51 -0400, Todd wrote: > My main issue with this is that, in my opinion, dunders are not > something a beginner should be messing with anyway. By the time > someone is experienced enough to start working on this, they are also > experienced enough to understand that

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-05 Thread Ricky Teachey
Hi Todd thanks for your response. On Tue, Aug 4, 2020 at 11:01 AM Todd wrote: > On Tue, Aug 4, 2020 at 8:17 AM Ricky Teachey wrote: > >> ... >> >> There could be several reasons for changing the item dunder signatures. >> The immediate reason is making the intuition around how to add kwd arg

[Python-ideas] Re: Changing item dunder method signatures to utilize positional arguments (open thread)

2020-08-04 Thread Todd
On Tue, Aug 4, 2020 at 8:17 AM Ricky Teachey wrote: > The following comment is from the thread about adding kwd arg support to > the square bracket operator (eg, `Vec = Dict[i=float, j=float]`). > > On Tue, Aug 4, 2020, 2:57 AM Greg Ewing > wrote: > > On 4/08/20 1:16 pm, Steven D'Aprano wrote: