Skip to content

Monty doesn't accept slice() arguments outside i64 range #370

Description

@davidhewitt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions