pyright
pyright copied to clipboard
Pyright 383 regression - reportArgumentType/npt.ArrayLike
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