Suggested feature: slice syntax within tuples (or even more generally)?

stephenwlin at stephenwlin at
Thu Feb 14 16:56:16 CET 2013

> You can't just allow ':' to generate slice objects everwhere without 
> introducing ambiguity, so your proposal would have to be to allow slice 
> objects in wider but still restricted contexts.

Yeah, I mentioned that in a follow-up. I'm pretty sure of just allowing it within [] and () would work, though, and still be a pretty consistent/simple grammar.

This would also remove Steven's (i.e. Guido's) objection that about

if x:

This would still preserves the main benefit of allowing you to succinctly create slices in any context you need an expression in, because you can always add () around any expression.


More information about the Python-list mailing list