pyright icon indicating copy to clipboard operation
pyright copied to clipboard

Pyright 383 regression - reportArgumentType/npt.ArrayLike

Open danielpopescu opened this issue 4 months ago • 0 comments


from __future__ import annotations

from typing import Any

import numpy as np
import numpy.typing as npt


def as_array(a: npt.ArrayLike) -> npt.NDArray[Any]:
    return np.array(a)


def test() -> int:
    lst = as_array([[1, 2], [3, 4]])
    return len(lst)

there is a new type error on the line lst is defined.

This worked in 382. Python 3.12.x, numpy 2.1.1

danielpopescu avatar Oct 02 '24 10:10 danielpopescu