[Python-ideas] Re: Ricky Teachey's email to me on PEP 637, and my responses

2020-10-28 Thread Christopher Barker
On Tue, Oct 27, 2020 at 11:24 PM Chris Angelico wrote: > On Wed, Oct 28, 2020 at 5:12 PM Stephen J. Turnbull > wrote: > > > thing[i,j,k] is exactly equivalent to thing[(i,j,k)] because the > tuple is > > > "created by" the parentheses. > > > > Is that correct? As I understand it, the tuple

[Python-ideas] Re: Ricky Teachey's email to me on PEP 637, and my responses

2020-10-28 Thread Jonathan Fine
Christopher Barker and Stephen J. Turnbull wrote: > As a statement clause separator, which becomes ambiguous: > > if thing: x > Yes. Very good. Well done, both of you. Now consider this. PEP 643 allows for things like obj[a=x:y] and "may open up the open the possibility" of allowing

[Python-ideas] Re: Ricky Teachey's email to me on PEP 637, and my responses

2020-10-28 Thread Brendan Barnwell
On 2020-10-27 23:10, Stephen J. Turnbull wrote: And in dict displays, where generalized slices could be used as components, rather than treating ':' merely as a separator. (I write "generalized" because I presume slices are currently specialized to ints). Non-int slices are valid and are

[Python-ideas] Re: Ricky Teachey's email to me on PEP 637, and my responses

2020-10-28 Thread Chris Angelico
On Wed, Oct 28, 2020 at 5:12 PM Stephen J. Turnbull wrote: > > Christopher Barker writes: > > > thing[i,j,k] is exactly equivalent to thing[(i,j,k)] because the tuple is > > "created by" the parentheses. > > Is that correct? As I understand it, the tuple is created by the > commas, and the

[Python-ideas] Re: Ricky Teachey's email to me on PEP 637, and my responses

2020-10-28 Thread Stephen J. Turnbull
Christopher Barker writes: > thing[i,j,k] is exactly equivalent to thing[(i,j,k)] because the tuple is > "created by" the parentheses. Is that correct? As I understand it, the tuple is created by the commas, and the parentheses are basically thrown away by the parser, as usual. > and

[Python-ideas] Re: Ricky Teachey's email to me on PEP 637, and my responses

2020-10-26 Thread Christopher Barker
It's been a while since this was posted, but a thought: Here's an idea. At present both of > > d[1:2] >> d[1:2, 3:4, 5, 6] >> are valid syntax, but neither of >> d[(1:2)] >> d[(1:2, 3:4, 5, 6)] >> are valid syntax. This is, I think, a bit of an anomaly. >> > indeed -- it's been

[Python-ideas] Re: Ricky Teachey's email to me on PEP 637, and my responses

2020-10-23 Thread Ricky Teachey
Jonathan thanks for your desire to make PEP 637, and kwd arguments in subscripting in general, as good as possible. I am bowing out of the conversation from this point on though. I am very happy you found my comments helpful and if there is a second competing PEP, I'll be very interested to read