Terry J. Reedy added the comment:
What you are or should be asking for is an alternate string representation
method, perhaps called 'colon', so that for instance
myslice.colon() == '::2'
The function could take an optional length (as with .indices, but optional) to
produce the same numbers a
New submission from Ross Barnowski :
It would be nice if there were a way to get a string representation of a slice
object in extended indexing syntax, e.g.
```
>>> myslice = slice(None, None, 2)
>>> print(myslice)
'::2'
```
One motivating use-case is in descriptive error messages, e.g.
```