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. As I said originally, I'm +0 on the whole feature but I think weird restrictions like "slice syntax only works for positional arguments" or "can't have both positional and keyword args" will be surprising to most people. _______________________________________________ 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/A3AN3QTM6BKX4ZME7RL3ITGCOFV2XVUH/ Code of Conduct: http://python.org/psf/codeofconduct/