Hi Andrew

(We're still a bit off-topic here.)  You asked me what I'd expect, if not
the present values of:

>>> seq[]
 SyntaxError: invalid syntax

>>> getslice[1:2:3:4]
SyntaxError: invalid syntax

I'd have expected to got respectively the outcome of

>>> seq.__getitem__()
>>> seq.__getitem__(slice(1, 2, 3, 4))

In other words, a run-time error rather than a syntax error.

And for the slice to make sense, perhaps also to have instead something
like:

>>>  seq.__getitem__(seq.__slice__(1, 2, 3, 4))

This would allow collections to have a custom slice class. And this would
perhaps open the door to

>>> seq[0, 1, key=3]

no longer being a SyntaxError. And now we're well off-topic. (I'll start a
new thread for this, if asked off-list to do so.)

-- 
Jonathan
_______________________________________________
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/QTI7DO3NDK5KA5U747Q5LDI4FJB3L6U6/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to