Skip to content

Bug: Ellipsis (...) as array index not handled #30

@swernerx

Description

@swernerx

Description

Python's Ellipsis (...) when used as an array index is not converted properly. In NumPy, arr[...] means "all elements" or "broadcast to all".

Python Input

self[...] = filler
result = arr[..., 0]
data[0, ...] = values

Current Output (v1.3.2)

self[...] = filler;  // INVALID! Spread syntax can't be used as index
result = arr[..., 0];  // INVALID!
data[0, ...] = values;  // INVALID!

Expected Output

Option A - Keep as-is with a placeholder constant:

const ELLIPSIS = Symbol('...')
self[ELLIPSIS] = filler;  // Still needs runtime support

Option B - Convert to appropriate NumPy-like method:

self.fill(filler);
result = arr.slice(null, 0);  // or arr.at(Ellipsis, 0)

Priority

🟡 Medium - NumPy-specific pattern

Notes

This is a NumPy-specific pattern. The Ellipsis literal in Python is a special singleton used for multi-dimensional array slicing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    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