Skip to content

BUG: Type annotation for np.ndindex doesn't accept tuples #20706

@NeilGirdhar

Description

@NeilGirdhar

The following should pass as far as I can tell:

import numpy as np
np.ndindex((1, 2))  # error: Argument 1 to "ndindex" has incompatible type "Tuple[int, ...]"; expected "SupportsIndex"

NumPy/Python version information:

1.22.0 3.10.1 (main, Dec 8 2021, 14:43:47) [GCC 9.3.0]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions