File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -950,7 +950,7 @@ np_1darray_dt: TypeAlias = np_1darray[np.datetime64]
950950np_1darray_td : TypeAlias = np_1darray [np .timedelta64 ]
951951np_2darray : TypeAlias = np .ndarray [tuple [int , int ], np .dtype [GenericT ]]
952952
953- NDArrayT = TypeVar ("NDArrayT" , bound = np . ndarray )
953+ NDArrayT = TypeVar ("NDArrayT" , bound = np_ndarray )
954954
955955DtypeNp = TypeVar ("DtypeNp" , bound = np .dtype [np .generic ])
956956KeysArgType : TypeAlias = Any
Original file line number Diff line number Diff line change 3737 np_1darray_bool ,
3838 np_1darray_int64 ,
3939 np_1darray_intp ,
40+ np_ndarray ,
4041 np_ndarray_dt ,
4142)
4243
@@ -1674,7 +1675,10 @@ def test_index_view() -> None:
16741675 ind = pd .Index ([1 , 2 ])
16751676 check (assert_type (ind .view ("int64" ), ArrayLike ), np_1darray_int64 )
16761677 check (assert_type (ind .view (), "pd.Index[int]" ), pd .Index )
1677- check (assert_type (ind .view (np .ndarray ), np .ndarray ), np .ndarray )
1678+ # mypy and pyright differ here in what they report:
1679+ # - mypy: ndarray[Any, Any]"
1680+ # - pyright: ndarray[tuple[Any, ...], dtype[Any]]
1681+ check (assert_type (ind .view (np .ndarray ), np_ndarray ), np .ndarray ) # type: ignore[assert-type]
16781682
16791683 class MyArray (np .ndarray ): ...
16801684
You can’t perform that action at this time.
0 commit comments