On CPython the slice constructor can accept any values, e.g.
>>> slice('foo')
slice(None, 'foo', None)
It is only the .indices() operation that can fail on non-integer types:
>>> slice('foo').indices(10)
Traceback (most recent call last):
File "<python-input-1>", line 1, in <module>
slice('foo').indices(10)
~~~~~~~~~~~~~~~~~~~~^^^^
TypeError: slice indices must be integers or None or have an __index__ method
Currently monty will fail to construct slice('foo'). We should decide if we care.
On CPython the slice constructor can accept any values, e.g.
It is only the
.indices()operation that can fail on non-integer types:Currently monty will fail to construct
slice('foo'). We should decide if we care.