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 slicing variants and you can fill in how it would look with
keyword arguments:
x[:]
x[a:]
x[-a:]
x[a:b]
x[-a:b]
x[a:-b]
x[-a:-b]
x[:b]
x[:-b]
x[kw=:] x[kw=a:] x[kw=-a:] x[kw=a:b] x[kw=-a:b] x[kw=a:-b] x[kw=-a:-b]
x[kw=:b] x[kw=:-b]
I don't see what's confusing. All that's needed is for the slice
syntax ['colon operator', if you like] to have higher precedence than
the keyword syntax, as it already has higher precedence than the comma.
I look forward to the walrus operator being thrown in, too!
I realize you'd have to use parens for the walrus operator to be used
inside [].
Eric
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/python-ideas@python.org/message/WTRITCQVXUDXJQDTQ3G3HRXFEKJ75ZM4/
Code of Conduct: http://python.org/psf/codeofconduct/