Skip to content

Properly Generate ExtSlice #1492

@vodik

Description

@vodik

Multi-dimensional lookup should emit ast.ExtSlice instead of a normal lookup with ast.Tuple.

Basically any time we'd generate this:

slice=Index(value=Tuple(elts=[Num(n=3), Ellipsis(), Num(n=5)], ctx=Load())

But if any of the elements of that tuple is an instance of ast.slice (ast.Slice and, on Python 2, ast.Ellipsis), it should be constructed as slice=ExtSlice(dims[...]) instead.

Related to #1491 if we want to add Python 2 support for Ellipsis. Otherwise its not too pressing since we don't have anything that emits ast.Slice directly, its always done as a function call. But if we where to add something, this issue would have to be resolved first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions