Repository navigation
Conversation
|
Diff from mypy_primer, showing the effect of this PR on type check results on a corpus of open source code: pandas (https://github.com/pandas-dev/pandas)
- pandas/core/dtypes/dtypes.py:526: error: Incompatible return value type (got "ndarray[tuple[Any, ...], dtype[unsignedinteger[_64Bit]]] | Any", expected "int") [return-value]
+ pandas/core/dtypes/dtypes.py:526: error: Incompatible return value type (got "ndarray[tuple[Any, ...], dtype[uint64]] | Any", expected "int") [return-value]
- pandas/io/formats/string.py:126: error: No overload variant of "__rsub__" of "signedinteger" matches argument type "None" [operator]
+ pandas/io/formats/string.py:126: error: No overload variant of "__rsub__" of "int64" matches argument type "None" [operator]
- pandas/io/formats/string.py:126: note: def __rsub__(self, int | signedinteger[_8Bit] | numpy.bool[builtins.bool], /) -> signedinteger[_32Bit | _64Bit]
+ pandas/io/formats/string.py:126: note: def __rsub__(self, int | signedinteger[Any] | uint32 | uint16 | uint8 | numpy.bool[builtins.bool], /) -> int64
- pandas/io/formats/string.py:126: note: def __rsub__(self, float, /) -> float64
+ pandas/io/formats/string.py:126: note: def __rsub__(self, float64 | uint64, /) -> float64
- pandas/io/formats/string.py:126: note: def __rsub__(self, complex, /) -> complex128
+ pandas/io/formats/string.py:126: note: def __rsub__(self, complex128, /) -> complex128
- pandas/io/formats/string.py:126: note: def __rsub__(self, signedinteger[Any], /) -> signedinteger[Any]
- pandas/io/formats/string.py:126: note: def __rsub__(self, integer[Any], /) -> Any
+ pandas/io/formats/string.py:126: note: def __rsub__(self, float, /) -> float64 | Any
+ pandas/io/formats/string.py:126: note: def __rsub__(self, complex, /) -> complex128 | Any
- pandas/io/formats/string.py:126: error: Incompatible types in assignment (expression has type "signedinteger[_32Bit | _64Bit] | Any", variable has type "int | None") [assignment]
+ pandas/io/formats/string.py:126: error: Incompatible types in assignment (expression has type "int64 | Any", variable has type "int | None") [assignment]
- pandas/io/formats/string.py:134: error: Argument 1 to "_binify" has incompatible type "list[signedinteger[_32Bit | _64Bit] | int]"; expected "list[int]" [arg-type]
+ pandas/io/formats/string.py:134: error: Argument 1 to "_binify" has incompatible type "list[int64 | int]"; expected "list[int]" [arg-type]
- pandas/core/algorithms.py:470: error: Incompatible return value type (got "signedinteger[_32Bit | _64Bit]", expected "int") [return-value]
+ pandas/core/algorithms.py:470: error: Incompatible return value type (got "int64", expected "int") [return-value]
- pandas/io/stata.py:352: error: Incompatible types in assignment (expression has type "vectorize[signedinteger[_32Bit | _64Bit], Callable[[datetime], int]]", variable has type "vectorize[float64, Callable[[timedelta], float]]") [assignment]
+ pandas/io/stata.py:352: error: Incompatible types in assignment (expression has type "vectorize[int64, Callable[[datetime], int]]", variable has type "vectorize[float64, Callable[[timedelta], float]]") [assignment]
- pandas/io/parsers/python_parser.py:1532: error: Incompatible return value type (got "list[tuple[signedinteger[_32Bit | _64Bit], signedinteger[_32Bit | _64Bit]]]", expected "list[tuple[int, int]]") [return-value]
+ pandas/io/parsers/python_parser.py:1532: error: Incompatible return value type (got "list[tuple[int64, int64]]", expected "list[tuple[int, int]]") [return-value]
- pandas/core/groupby/groupby.py:1748: error: Incompatible types in assignment (expression has type "ndarray[tuple[Any, ...], dtype[float64]]", variable has type "ndarray[tuple[int], dtype[signedinteger[_32Bit | _64Bit]]]") [assignment]
+ pandas/core/groupby/groupby.py:1748: error: Incompatible types in assignment (expression has type "ndarray[tuple[Any, ...], dtype[float64]]", variable has type "ndarray[tuple[int], dtype[int64]]") [assignment]
- pandas/core/groupby/generic.py:1253: error: Incompatible types in assignment (expression has type "ndarray[tuple[Any, ...], dtype[signedinteger[_32Bit | _64Bit]]] | None", variable has type "ndarray[Any, Any]") [assignment]
+ pandas/core/groupby/generic.py:1253: error: Incompatible types in assignment (expression has type "ndarray[tuple[Any, ...], dtype[int64]] | None", variable has type "ndarray[Any, Any]") [assignment]
+ pandas/core/groupby/ops.py:900: error: Argument 2 to "_ob_index_and_ids" of "BaseGrouper" has incompatible type "list[ndarray[tuple[Any, ...], dtype[signedinteger[Any]]]]"; expected "list[ndarray[tuple[Any, ...], dtype[int64]]]" [arg-type]
+ pandas/core/groupby/ops.py:903: error: Argument 2 to "_unob_index_and_ids" of "BaseGrouper" has incompatible type "list[ndarray[tuple[Any, ...], dtype[signedinteger[Any]]]]"; expected "list[ndarray[tuple[Any, ...], dtype[int64]]]" [arg-type]
+ pandas/core/groupby/ops.py:912: error: List comprehension has incompatible type List[ndarray[tuple[Any, ...], dtype[signedinteger[Any]]]]; expected List[ndarray[tuple[Any, ...], dtype[int64]]] [misc]
+ pandas/core/groupby/ops.py:918: error: List comprehension has incompatible type List[ndarray[tuple[Any, ...], dtype[signedinteger[Any]]]]; expected List[ndarray[tuple[Any, ...], dtype[int64]]] [misc]
+ pandas/core/groupby/ops.py:1392: error: Signature of "codes" incompatible with supertype "BaseGrouper" [override]
+ pandas/core/groupby/ops.py:1392: note: Superclass:
+ pandas/core/groupby/ops.py:1392: note: list[ndarray[tuple[Any, ...], dtype[signedinteger[Any]]]]
+ pandas/core/groupby/ops.py:1392: note: Subclass:
+ pandas/core/groupby/ops.py:1392: note: list[ndarray[tuple[Any, ...], dtype[int64]]]
- pandas/io/formats/excel.py:664: error: Argument "css_col" to "CssExcelCell" has incompatible type "signedinteger[_32Bit | _64Bit]"; expected "int" [arg-type]
+ pandas/io/formats/excel.py:664: error: Argument "css_col" to "CssExcelCell" has incompatible type "int64"; expected "int" [arg-type]
- pandas/io/formats/excel.py:698: error: Argument "css_col" to "CssExcelCell" has incompatible type "signedinteger[_32Bit | _64Bit]"; expected "int" [arg-type]
+ pandas/io/formats/excel.py:698: error: Argument "css_col" to "CssExcelCell" has incompatible type "int64"; expected "int" [arg-type]
- pandas/io/formats/excel.py:880: error: Argument "css_col" to "CssExcelCell" has incompatible type "signedinteger[_32Bit | _64Bit]"; expected "int" [arg-type]
+ pandas/io/formats/excel.py:880: error: Argument "css_col" to "CssExcelCell" has incompatible type "int64"; expected "int" [arg-type]
- pandas/core/reshape/reshape.py:153: error: Incompatible types in assignment (expression has type "signedinteger[_32Bit | _64Bit]", variable has type "int") [assignment]
+ pandas/core/reshape/reshape.py:153: error: Incompatible types in assignment (expression has type "int64", variable has type "int") [assignment]
jax (https://github.com/google/jax)
- jax/_src/array.py:448: note: def asarray(a: Sequence[list[int]], dtype: None = ..., order: Literal['K', 'A', 'C', 'F'] | None = ..., *, device: Literal['cpu'] | None = ..., copy: bool | None = ..., like: _SupportsArrayFunc | None = ...) -> ndarray[tuple[int, int], dtype[signedinteger[_32Bit | _64Bit]]]
+ jax/_src/array.py:448: note: def asarray(a: Sequence[list[int]], dtype: None = ..., order: Literal['K', 'A', 'C', 'F'] | None = ..., *, device: Literal['cpu'] | None = ..., copy: bool | None = ..., like: _SupportsArrayFunc | None = ...) -> ndarray[tuple[int, int], dtype[int64]]
- jax/_src/array.py:448: note: def asarray(a: Sequence[Sequence[list[int]]], dtype: None = ..., order: Literal['K', 'A', 'C', 'F'] | None = ..., *, device: Literal['cpu'] | None = ..., copy: bool | None = ..., like: _SupportsArrayFunc | None = ...) -> ndarray[tuple[int, int, int], dtype[signedinteger[_32Bit | _64Bit]]]
+ jax/_src/array.py:448: note: def asarray(a: Sequence[Sequence[list[int]]], dtype: None = ..., order: Literal['K', 'A', 'C', 'F'] | None = ..., *, device: Literal['cpu'] | None = ..., copy: bool | None = ..., like: _SupportsArrayFunc | None = ...) -> ndarray[tuple[int, int, int], dtype[int64]]
- jax/_src/array.py:448: note: def asarray(a: list[int], dtype: None = ..., order: Literal['K', 'A', 'C', 'F'] | None = ..., *, device: Literal['cpu'] | None = ..., copy: bool | None = ..., like: _SupportsArrayFunc | None = ...) -> ndarray[tuple[int], dtype[signedinteger[_32Bit | _64Bit]]]
+ jax/_src/array.py:448: note: def asarray(a: list[int], dtype: None = ..., order: Literal['K', 'A', 'C', 'F'] | None = ..., *, device: Literal['cpu'] | None = ..., copy: bool | None = ..., like: _SupportsArrayFunc | None = ...) -> ndarray[tuple[int], dtype[int64]]
- jax/_src/array.py:448: note: def asarray(a: int, dtype: None = ..., order: Literal['K', 'A', 'C', 'F'] | None = ..., *, device: Literal['cpu'] | None = ..., copy: bool | None = ..., like: _SupportsArrayFunc | None = ...) -> ndarray[tuple[()], dtype[signedinteger[_32Bit | _64Bit] | Any]]
+ jax/_src/array.py:448: note: def asarray(a: int, dtype: None = ..., order: Literal['K', 'A', 'C', 'F'] | None = ..., *, device: Literal['cpu'] | None = ..., copy: bool | None = ..., like: _SupportsArrayFunc | None = ...) -> ndarray[tuple[()], dtype[int64 | Any]]
- jax/_src/numpy/indexing.py:364: note: def __radd__(self, int, /) -> signedinteger[_32Bit | _64Bit]
+ jax/_src/numpy/indexing.py:364: note: def __radd__(self, int, /) -> int64
- jax/_src/numpy/indexing.py:364: error: Incompatible types in assignment (expression has type "Array | ndarray[tuple[Any, ...], dtype[Any]] | signedinteger[_32Bit | _64Bit] | Any | int | <6 more items> | None", variable has type "int | integer[Any] | slice[Any, Any, Any] | EllipsisType | Sequence[int | integer[Any]] | Array | ndarray[tuple[Any, ...], dtype[Any]] | None") [assignment]
+ jax/_src/numpy/indexing.py:364: error: Incompatible types in assignment (expression has type "Array | ndarray[tuple[Any, ...], dtype[Any]] | int64 | Any | int | <6 more items> | None", variable has type "int | integer[Any] | slice[Any, Any, Any] | EllipsisType | Sequence[int | integer[Any]] | Array | ndarray[tuple[Any, ...], dtype[Any]] | None") [assignment]
- jax/_src/numpy/hijax.py:632: error: Incompatible types in assignment (expression has type "tuple[Any, ...]", variable has type "ndarray[tuple[Any, ...], dtype[signedinteger[_64Bit]]]") [assignment]
+ jax/_src/numpy/hijax.py:632: error: Incompatible types in assignment (expression has type "tuple[Any, ...]", variable has type "ndarray[tuple[Any, ...], dtype[int64]]") [assignment]
- jax/_src/numpy/lax_numpy.py:6012: error: Value of type variable "T" of "__call__" of "_ufunc_11_bifo" cannot be "Array | ndarray[tuple[Any, ...], dtype[Any]] | Any | signedinteger[_32Bit | _64Bit] | int | float | complex" [type-var]
+ jax/_src/numpy/lax_numpy.py:6012: error: Value of type variable "T" of "__call__" of "_ufunc_11_bifo" cannot be "Array | ndarray[tuple[Any, ...], dtype[Any]] | Any | int64 | int | float | complex" [type-var]
- jax/_src/numpy/lax_numpy.py:6012: error: Argument 1 to "int" has incompatible type "Array | ndarray[tuple[Any, ...], dtype[Any]] | Any | signedinteger[_32Bit | _64Bit] | int | float | complex"; expected "str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc" [arg-type]
+ jax/_src/numpy/lax_numpy.py:6012: error: Argument 1 to "int" has incompatible type "Array | ndarray[tuple[Any, ...], dtype[Any]] | Any | int64 | int | float | complex"; expected "str | Buffer | SupportsInt | SupportsIndex | SupportsTrunc" [arg-type]
- jax/_src/numpy/ufuncs.py:3075: error: Argument 1 to "signedinteger" has incompatible type "object"; expected "SupportsInt | SupportsIndex | str | bytes" [arg-type]
+ jax/_src/numpy/ufuncs.py:3075: error: Argument 1 to "int32" has incompatible type "object"; expected "SupportsInt | SupportsIndex | str | bytes" [arg-type]
- jax/_src/random/core.py:2066: error: Incompatible types in assignment (expression has type "dtype[floating[_32Bit]]", variable has type "dtype[float64]") [assignment]
+ jax/_src/random/core.py:2066: error: Incompatible types in assignment (expression has type "dtype[float32]", variable has type "dtype[float64]") [assignment]
- jax/_src/checkify.py:246: error: Value of type "int | signedinteger[_32Bit] | Array" is not indexable [index]
+ jax/_src/checkify.py:246: error: Value of type "int | int32 | Array" is not indexable [index]
- jax/_src/checkify.py:247: error: Value of type "int | signedinteger[_32Bit] | Array" is not indexable [index]
+ jax/_src/checkify.py:247: error: Value of type "int | int32 | Array" is not indexable [index]
- jax/experimental/mosaic/gpu/launch_context.py:1079: error: Incompatible types in assignment (expression has type "signedinteger[_32Bit | _64Bit]", variable has type "int") [assignment]
+ jax/experimental/mosaic/gpu/launch_context.py:1079: error: Incompatible types in assignment (expression has type "int64", variable has type "int") [assignment]
- jax/_src/pallas/fuser/block_spec.py:2281: error: No overload variant of "__getitem__" of "Sequence" matches argument type "signedinteger[_32Bit | _64Bit]" [call-overload]
+ jax/_src/pallas/fuser/block_spec.py:2281: error: No overload variant of "__getitem__" of "Sequence" matches argument type "int64" [call-overload]
- jax/_src/pallas/fuser/block_spec.py:2625: error: Argument 1 to "append" of "list" has incompatible type "tuple[signedinteger[_32Bit], ...]"; expected "tuple[int | Any]" [arg-type]
+ jax/_src/pallas/fuser/block_spec.py:2625: error: Argument 1 to "append" of "list" has incompatible type "tuple[int32, ...]"; expected "tuple[int | Any]" [arg-type]
- jax/_src/third_party/scipy/special.py:304: note: Left operand is of type "Array | ndarray[tuple[Any, ...], dtype[Any]] | numpy.bool[builtins.bool] | number[Any, Any] | signedinteger[_32Bit | _64Bit] | Any | int | float | complex"
+ jax/_src/third_party/scipy/special.py:304: note: Left operand is of type "Array | ndarray[tuple[Any, ...], dtype[Any]] | numpy.bool[builtins.bool] | number[Any, Any] | int64 | Any | int | float | complex"
- jax/_src/internal_test_util/test_harnesses.py:841: error: Incompatible types in assignment (expression has type "ndarray[tuple[int], dtype[number[_32Bit, float]]]", variable has type "ndarray[tuple[int, int], dtype[floating[_32Bit]]]") [assignment]
+ jax/_src/internal_test_util/test_harnesses.py:841: error: Incompatible types in assignment (expression has type "ndarray[tuple[int], dtype[number[_32Bit, float]]]", variable has type "ndarray[tuple[int, int], dtype[float32]]") [assignment]
- jax/_src/internal_test_util/test_harnesses.py:1117: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[integer[_32Bit]]]", variable has type "ndarray[tuple[()], dtype[signedinteger[_32Bit]]]") [assignment]
+ jax/_src/internal_test_util/test_harnesses.py:1117: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[integer[_32Bit]]]", variable has type "ndarray[tuple[()], dtype[int32]]") [assignment]
- jax/_src/internal_test_util/test_harnesses.py:1228: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, int], dtype[signedinteger[_32Bit | _64Bit]]]", variable has type "list[list[int]]") [assignment]
+ jax/_src/internal_test_util/test_harnesses.py:1228: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, int], dtype[int64]]", variable has type "list[list[int]]") [assignment]
- jax/_src/internal_test_util/test_harnesses.py:1269: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, int], dtype[signedinteger[_32Bit | _64Bit]]]", variable has type "list[list[int]]") [assignment]
+ jax/_src/internal_test_util/test_harnesses.py:1269: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, int], dtype[int64]]", variable has type "list[list[int]]") [assignment]
- jax/_src/internal_test_util/test_harnesses.py:1659: error: Incompatible types in assignment (expression has type "ndarray[tuple[int], dtype[number[_32Bit, float]]]", variable has type "ndarray[tuple[int, int], dtype[floating[_32Bit]]]") [assignment]
+ jax/_src/internal_test_util/test_harnesses.py:1659: error: Incompatible types in assignment (expression has type "ndarray[tuple[int], dtype[number[_32Bit, float]]]", variable has type "ndarray[tuple[int, int], dtype[float32]]") [assignment]
- jax/_src/internal_test_util/test_harnesses.py:1720: error: Incompatible types in assignment (expression has type "list[object]", variable has type "list[ndarray[tuple[int], dtype[floating[_32Bit]]]]") [assignment]
+ jax/_src/internal_test_util/test_harnesses.py:1720: error: Incompatible types in assignment (expression has type "list[object]", variable has type "list[ndarray[tuple[int], dtype[float32]]]") [assignment]
- jax/_src/internal_test_util/test_harnesses.py:2233: error: Incompatible types in assignment (expression has type "tuple[ndarray[tuple[()], dtype[unsignedinteger[_8Bit]]] | ndarray[tuple[()], dtype[unsignedinteger[_32Bit]]] | int, ...]", variable has type "list[list[int]]") [assignment]
+ jax/_src/internal_test_util/test_harnesses.py:2233: error: Incompatible types in assignment (expression has type "tuple[ndarray[tuple[()], dtype[uint8]] | ndarray[tuple[()], dtype[uint32]] | int, ...]", variable has type "list[list[int]]") [assignment]
- jax/_src/internal_test_util/test_harnesses.py:2233: error: Incompatible types in assignment (expression has type "tuple[ndarray[tuple[()], dtype[unsignedinteger[_8Bit]]] | ndarray[tuple[()], dtype[unsignedinteger[_32Bit]]] | int, ...]", variable has type "tuple[int, ...]") [assignment]
+ jax/_src/internal_test_util/test_harnesses.py:2233: error: Incompatible types in assignment (expression has type "tuple[ndarray[tuple[()], dtype[uint8]] | ndarray[tuple[()], dtype[uint32]] | int, ...]", variable has type "tuple[int, ...]") [assignment]
- jax/_src/internal_test_util/test_harnesses.py:2292: error: Incompatible types in assignment (expression has type "tuple[ndarray[tuple[()], dtype[unsignedinteger[_8Bit]]] | ndarray[tuple[()], dtype[unsignedinteger[_32Bit]]] | int, ...]", variable has type "list[list[int]]") [assignment]
+ jax/_src/internal_test_util/test_harnesses.py:2292: error: Incompatible types in assignment (expression has type "tuple[ndarray[tuple[()], dtype[uint8]] | ndarray[tuple[()], dtype[uint32]] | int, ...]", variable has type "list[list[int]]") [assignment]
xarray (https://github.com/pydata/xarray)
- xarray/core/coordinates.py:166: error: Incompatible types in assignment (expression has type "ndarray[tuple[int], dtype[float64]]", variable has type "ndarray[tuple[int], dtype[signedinteger[_32Bit | _64Bit]]]") [assignment]
+ xarray/core/coordinates.py:166: error: Incompatible types in assignment (expression has type "ndarray[tuple[int], dtype[float64]]", variable has type "ndarray[tuple[int], dtype[int64]]") [assignment]
- xarray/tests/test_namedarray.py:369: error: Incompatible types in assignment (expression has type "ndarray[tuple[int], dtype[object_[float]]]", variable has type "ndarray[tuple[Any, ...], dtype[signedinteger[_64Bit]]]") [assignment]
+ xarray/tests/test_namedarray.py:369: error: Incompatible types in assignment (expression has type "ndarray[tuple[int], dtype[object_[float]]]", variable has type "ndarray[tuple[Any, ...], dtype[int64]]") [assignment]
static-frame (https://github.com/static-frame/static-frame)
- static_frame/core/rank.py:60: error: Incompatible types in assignment (expression has type "signedinteger[_64Bit] | float64", variable has type "int") [assignment]
+ static_frame/core/rank.py:60: error: Incompatible types in assignment (expression has type "int64 | float64", variable has type "int") [assignment]
- static_frame/core/rank.py:76: error: Incompatible types in assignment (expression has type "signedinteger[_64Bit] | float64", variable has type "int") [assignment]
+ static_frame/core/rank.py:76: error: Incompatible types in assignment (expression has type "int64 | float64", variable has type "int") [assignment]
- static_frame/core/rank.py:172: error: Incompatible types in assignment (expression has type "signedinteger[_64Bit] | float64", variable has type "int") [assignment]
+ static_frame/core/rank.py:172: error: Incompatible types in assignment (expression has type "int64 | float64", variable has type "int") [assignment]
- static_frame/core/loc_map.py:333: error: Incompatible return value type (got "tuple[ndarray[tuple[int], dtype[unsignedinteger[_64Bit]]], numpy.bool[builtins.bool]]", expected "tuple[ndarray[Any, Any], builtins.bool]") [return-value]
+ static_frame/core/loc_map.py:333: error: Incompatible return value type (got "tuple[ndarray[tuple[int], dtype[uint64]], numpy.bool[builtins.bool]]", expected "tuple[ndarray[Any, Any], builtins.bool]") [return-value]
- static_frame/core/loc_map.py:428: error: Incompatible types in assignment (expression has type "ndarray[tuple[int], dtype[unsignedinteger[_64Bit]]]", variable has type "ndarray[tuple[int, int], dtype[unsignedinteger[_64Bit]]]") [assignment]
+ static_frame/core/loc_map.py:428: error: Incompatible types in assignment (expression has type "ndarray[tuple[int], dtype[uint64]]", variable has type "ndarray[tuple[int, int], dtype[uint64]]") [assignment]
scikit-learn (https://github.com/scikit-learn/scikit-learn)
- sklearn/externals/array_api_compat/numpy/_aliases.py:126: error: Argument 2 to "take_along_axis" has incompatible type "ndarray[Any, dtype[numpy.bool[builtins.bool] | integer[Any] | floating[_32Bit] | float64 | complexfloating[_32Bit, _32Bit] | complex128]]"; expected "ndarray[Any, dtype[integer[Any]]]" [arg-type]
+ sklearn/externals/array_api_compat/numpy/_aliases.py:126: error: Argument 2 to "take_along_axis" has incompatible type "ndarray[Any, dtype[numpy.bool[builtins.bool] | integer[Any] | float32 | float64 | complex64 | complex128]]"; expected "ndarray[Any, dtype[integer[Any]]]" [arg-type]
- sklearn/utils/tests/test_sparsefuncs.py:451: note: def [T] hstack(blocks: Sequence[_CanStackAs[signedinteger[_32Bit | _64Bit], T]], format: None = ..., *, dtype: type[JustInt] | type[signedinteger[_64Bit]] | dtype[signedinteger[_64Bit]] | HasDType[dtype[signedinteger[_64Bit]]] | Literal['int_', 'int', 'intp', 'n', '<n', '>n']) -> T
+ sklearn/utils/tests/test_sparsefuncs.py:451: note: def [T] hstack(blocks: Sequence[_CanStackAs[int64, T]], format: None = ..., *, dtype: type[JustInt] | type[int64] | dtype[int64] | HasDType[dtype[int64]] | Literal['int_', 'int', 'intp', 'n', '<n', '>n']) -> T
- sklearn/utils/tests/test_sparsefuncs.py:451: note: def hstack(blocks: Sequence[sparray[Any, tuple[Any, ...]]], format: Literal['bsr'], dtype: type[JustInt] | type[signedinteger[_64Bit]] | dtype[signedinteger[_64Bit]] | HasDType[dtype[signedinteger[_64Bit]]] | Literal['int_', 'int', 'intp', 'n', '<n', '>n']) -> bsr_array[signedinteger[_32Bit | _64Bit]]
+ sklearn/utils/tests/test_sparsefuncs.py:451: note: def hstack(blocks: Sequence[sparray[Any, tuple[Any, ...]]], format: Literal['bsr'], dtype: type[JustInt] | type[int64] | dtype[int64] | HasDType[dtype[int64]] | Literal['int_', 'int', 'intp', 'n', '<n', '>n']) -> bsr_array[int64]
- sklearn/utils/tests/test_sparsefuncs.py:451: note: def hstack(blocks: Sequence[sparray[Any, tuple[Any, ...]]], format: Literal['coo'], dtype: type[JustInt] | type[signedinteger[_64Bit]] | dtype[signedinteger[_64Bit]] | HasDType[dtype[signedinteger[_64Bit]]] | Literal['int_', 'int', 'intp', 'n', '<n', '>n']) -> coo_array[signedinteger[_32Bit | _64Bit], tuple[int, int]]
+ sklearn/utils/tests/test_sparsefuncs.py:451: note: def hstack(blocks: Sequence[sparray[Any, tuple[Any, ...]]], format: Literal['coo'], dtype: type[JustInt] | type[int64] | dtype[int64] | HasDType[dtype[int64]] | Literal['int_', 'int', 'intp', 'n', '<n', '>n']) -> coo_array[int64, tuple[int, int]]
- sklearn/utils/tests/test_sparsefuncs.py:451: note: def hstack(blocks: Sequence[sparray[Any, tuple[Any, ...]]], format: Literal['csc'], dtype: type[JustInt] | type[signedinteger[_64Bit]] | dtype[signedinteger[_64Bit]] | HasDType[dtype[signedinteger[_64Bit]]] | Literal['int_', 'int', 'intp', 'n', '<n', '>n']) -> csc_array[signedinteger[_32Bit | _64Bit]]
+ sklearn/utils/tests/test_sparsefuncs.py:451: note: def hstack(blocks: Sequence[sparray[Any, tuple[Any, ...]]], format: Literal['csc'], dtype: type[JustInt] | type[int64] | dtype[int64] | HasDType[dtype[int64]] | Literal['int_', 'int', 'intp', 'n', '<n', '>n']) -> csc_array[int64]
- sklearn/utils/tests/test_sparsefuncs.py:451: note: def hstack(blocks: Sequence[sparray[Any, tuple[Any, ...]]], format: Literal['csr'], dtype: type[JustInt] | type[signedinteger[_64Bit]] | dtype[signedinteger[_64Bit]] | HasDType[dtype[signedinteger[_64Bit]]] | Literal['int_', 'int', 'intp', 'n', '<n', '>n']) -> csr_array[signedinteger[_32Bit | _64Bit], tuple[int, int]]
+ sklearn/utils/tests/test_sparsefuncs.py:451: note: def hstack(blocks: Sequence[sparray[Any, tuple[Any, ...]]], format: Literal['csr'], dtype: type[JustInt] | type[int64] | dtype[int64] | HasDType[dtype[int64]] | Literal['int_', 'int', 'intp', 'n', '<n', '>n']) -> csr_array[int64, tuple[int, int]]
+ sklearn/utils/tests/test_sparsefuncs.py:451: note: def hstack(blocks: Sequence[sparray[Any, tuple[Any, ...]]], format: Literal['dia'], dtype: type[JustInt] | type[int64] | dtype[int64] | HasDType[dtype[int64]] | Literal['int_', 'int', 'intp', 'n', '<n', '>n']) -> dia_array[int64]
- sklearn/utils/tests/test_sparsefuncs.py:451: note: def hstack(blocks: Sequence[sparray[Any, tuple[Any, ...]]], format: Literal['dia'], dtype: type[JustInt] | type[signedinteger[_64Bit]] | dtype[signedinteger[_64Bit]] | HasDType[dtype[signedinteger[_64Bit]]] | Literal['int_', 'int', 'intp', 'n', '<n', '>n']) -> dia_array[signedinteger[_32Bit | _64Bit]]
+ sklearn/utils/tests/test_sparsefuncs.py:451: note: def hstack(blocks: Sequence[sparray[Any, tuple[Any, ...]]], format: Literal['dok'], dtype: type[JustInt] | type[int64] | dtype[int64] | HasDType[dtype[int64]] | Literal['int_', 'int', 'intp', 'n', '<n', '>n']) -> dok_array[int64, tuple[int, int]]
- sklearn/utils/tests/test_sparsefuncs.py:451: note: def hstack(blocks: Sequence[sparray[Any, tuple[Any, ...]]], format: Literal['dok'], dtype: type[JustInt] | type[signedinteger[_64Bit]] | dtype[signedinteger[_64Bit]] | HasDType[dtype[signedinteger[_64Bit]]] | Literal['int_', 'int', 'intp', 'n', '<n', '>n']) -> dok_array[signedinteger[_32Bit | _64Bit], tuple[int, int]]
- sklearn/utils/tests/test_sparsefuncs.py:451: note: def hstack(blocks: Sequence[sparray[Any, tuple[Any, ...]]], format: Literal['lil'], dtype: type[JustInt] | type[signedinteger[_64Bit]] | dtype[signedinteger[_64Bit]] | HasDType[dtype[signedinteger[_64Bit]]] | Literal['int_', 'int', 'intp', 'n', '<n', '>n']) -> lil_array[signedinteger[_32Bit | _64Bit]]
+ sklearn/utils/tests/test_sparsefuncs.py:451: note: def hstack(blocks: Sequence[sparray[Any, tuple[Any, ...]]], format: Literal['lil'], dtype: type[JustInt] | type[int64] | dtype[int64] | HasDType[dtype[int64]] | Literal['int_', 'int', 'intp', 'n', '<n', '>n']) -> lil_array[int64]
pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
- tests/series/timedelta/test_floordiv.py:148: error: Expression is of type "ndarray[tuple[Any, ...], dtype[Any]]", not "ndarray[tuple[Any, ...], dtype[signedinteger[_8Bit]]]" [assert-type]
+ tests/series/timedelta/test_floordiv.py:148: error: Expression is of type "ndarray[tuple[Any, ...], dtype[Any]]", not "ndarray[tuple[Any, ...], dtype[int8]]" [assert-type]
- tests/series/int/test_floordiv.py:137: error: Expression is of type "ndarray[tuple[int], dtype[Any]]", not "ndarray[tuple[Any, ...], dtype[signedinteger[_8Bit]]]" [assert-type]
+ tests/series/int/test_floordiv.py:137: error: Expression is of type "ndarray[tuple[int], dtype[Any]]", not "ndarray[tuple[Any, ...], dtype[int8]]" [assert-type]
- tests/indexes/timedeltaindex/test_floordiv.py:98: error: Expression is of type "ndarray[tuple[Any, ...], dtype[Any]]", not "ndarray[tuple[Any, ...], dtype[signedinteger[_8Bit]]]" [assert-type]
+ tests/indexes/timedeltaindex/test_floordiv.py:98: error: Expression is of type "ndarray[tuple[Any, ...], dtype[Any]]", not "ndarray[tuple[Any, ...], dtype[int8]]" [assert-type]
- tests/indexes/int/test_floordiv.py:97: error: Expression is of type "ndarray[tuple[int], dtype[Any]]", not "ndarray[tuple[Any, ...], dtype[signedinteger[_8Bit]]]" [assert-type]
+ tests/indexes/int/test_floordiv.py:97: error: Expression is of type "ndarray[tuple[int], dtype[Any]]", not "ndarray[tuple[Any, ...], dtype[int8]]" [assert-type]
- tests/indexes/float/test_floordiv.py:97: error: Expression is of type "ndarray[tuple[int], dtype[Any]]", not "ndarray[tuple[Any, ...], dtype[signedinteger[_8Bit]]]" [assert-type]
+ tests/indexes/float/test_floordiv.py:97: error: Expression is of type "ndarray[tuple[int], dtype[Any]]", not "ndarray[tuple[Any, ...], dtype[int8]]" [assert-type]
colour (https://github.com/colour-science/colour)
- colour/utilities/array.py:1311: error: Incompatible return value type (got "float64", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]") [return-value]
+ colour/utilities/array.py:1311: error: Incompatible return value type (got "float64", expected "ndarray[tuple[Any, ...], dtype[float16 | float32 | float64]]") [return-value]
- colour/utilities/array.py:1528: error: Incompatible return value type (got "float64", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]") [return-value]
+ colour/utilities/array.py:1528: error: Incompatible return value type (got "float64", expected "ndarray[tuple[Any, ...], dtype[float16 | float32 | float64]]") [return-value]
- colour/utilities/array.py:1567: error: Incompatible return value type (got "float64", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]") [return-value]
+ colour/utilities/array.py:1567: error: Incompatible return value type (got "float64", expected "ndarray[tuple[Any, ...], dtype[float16 | float32 | float64]]") [return-value]
- colour/utilities/array.py:1608: error: Incompatible return value type (got "complex128 | Any", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]") [return-value]
+ colour/utilities/array.py:1608: error: Incompatible return value type (got "complex128 | Any", expected "ndarray[tuple[Any, ...], dtype[float16 | float32 | float64]]") [return-value]
- colour/utilities/array.py:1819: error: Incompatible return value type (got "complex128 | Any", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]") [return-value]
+ colour/utilities/array.py:1819: error: Incompatible return value type (got "complex128 | Any", expected "ndarray[tuple[Any, ...], dtype[float16 | float32 | float64]]") [return-value]
- colour/utilities/array.py:2250: error: Incompatible return value type (got "ndarray[tuple[int], dtype[complex128 | Any]]", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]] | tuple[ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]], float]") [return-value]
+ colour/utilities/array.py:2250: error: Incompatible return value type (got "ndarray[tuple[int], dtype[complex128 | Any]]", expected "ndarray[tuple[Any, ...], dtype[float16 | float32 | float64]] | tuple[ndarray[tuple[Any, ...], dtype[float16 | float32 | float64]], float]") [return-value]
- colour/utilities/array.py:3266: error: Argument 1 to "signedinteger" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]"; expected "SupportsInt | SupportsIndex | str | bytes" [arg-type]
+ colour/utilities/array.py:3266: error: Argument 1 to "int8" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]"; expected "SupportsInt | SupportsIndex | str | bytes" [arg-type]
+ colour/utilities/array.py:3266: error: Argument 1 to "int16" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]"; expected "SupportsInt | SupportsIndex | str | bytes" [arg-type]
+ colour/utilities/array.py:3266: error: Argument 1 to "int32" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]"; expected "SupportsInt | SupportsIndex | str | bytes" [arg-type]
+ colour/utilities/array.py:3266: error: Argument 1 to "int64" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]"; expected "SupportsInt | SupportsIndex | str | bytes" [arg-type]
- colour/utilities/array.py:3266: error: Argument 1 to "unsignedinteger" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]"; expected "SupportsInt | SupportsIndex | str | bytes" [arg-type]
+ colour/utilities/array.py:3266: error: Argument 1 to "uint8" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]"; expected "SupportsInt | SupportsIndex | str | bytes" [arg-type]
+ colour/utilities/array.py:3266: error: Argument 1 to "uint16" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]"; expected "SupportsInt | SupportsIndex | str | bytes" [arg-type]
+ colour/utilities/array.py:3266: error: Argument 1 to "uint32" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]"; expected "SupportsInt | SupportsIndex | str | bytes" [arg-type]
+ colour/utilities/array.py:3266: error: Argument 1 to "uint64" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]"; expected "SupportsInt | SupportsIndex | str | bytes" [arg-type]
- colour/utilities/array.py:3334: error: Argument 1 to "floating" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]"; expected "SupportsFloat | SupportsIndex | str | bytes | None" [arg-type]
+ colour/utilities/array.py:3334: error: Argument 1 to "float16" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]"; expected "SupportsFloat | SupportsIndex | str | bytes | None" [arg-type]
+ colour/utilities/array.py:3334: error: Argument 1 to "float32" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]"; expected "SupportsFloat | SupportsIndex | str | bytes | None" [arg-type]
- colour/algebra/interpolation.py:1594: error: Incompatible types in assignment (expression has type "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]", variable has type "ndarray[tuple[Any, ...], dtype[float64]]") [assignment]
+ colour/algebra/interpolation.py:1594: error: Incompatible types in assignment (expression has type "ndarray[tuple[Any, ...], dtype[float16 | float32 | float64]]", variable has type "ndarray[tuple[Any, ...], dtype[float64]]") [assignment]
- colour/models/rgb/ycocg.py:52: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, int], dtype[signedinteger[_32Bit | _64Bit]]]", variable has type "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]") [assignment]
+ colour/models/rgb/ycocg.py:52: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, int], dtype[int64]]", variable has type "ndarray[tuple[Any, ...], dtype[float16 | float32 | float64]]") [assignment]
- colour/io/image.py:350: error: Incompatible return value type (got "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]", expected "ndarray[tuple[Any, ...], dtype[signedinteger[_8Bit] | signedinteger[_16Bit] | signedinteger[_32Bit] | signedinteger[_64Bit] | unsignedinteger[_8Bit] | unsignedinteger[_16Bit] | unsignedinteger[_32Bit] | unsignedinteger[_64Bit] | floating[_16Bit] | floating[_32Bit] | float64]]") [return-value]
+ colour/io/image.py:350: error: Incompatible return value type (got "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]", expected "ndarray[tuple[Any, ...], dtype[int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | float16 | float32 | float64]]") [return-value]
- colour/io/luts/lut.py:1433: error: No overload variant of "pad" matches argument types "ndarray[Any, Any]", "tuple[int, Any | signedinteger[_8Bit] | signedinteger[_16Bit] | signedinteger[_32Bit] | signedinteger[_64Bit] | unsignedinteger[_8Bit] | unsignedinteger[_16Bit] | unsignedinteger[_32Bit] | unsignedinteger[_64Bit]]", "str", "float" [call-overload]
+ colour/io/luts/lut.py:1433: error: No overload variant of "pad" matches argument types "ndarray[Any, Any]", "tuple[int, Any | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64]", "str", "float" [call-overload]
- colour/io/luts/lut.py:1433: note: def pad(array: list[int], pad_width: _SupportsArray[dtype[integer[Any]]] | _NestedSequence[_SupportsArray[dtype[integer[Any]]]] | int | _NestedSequence[int] | dict[int, int] | dict[int, tuple[int, int]] | dict[int, int | tuple[int, int]], mode: Literal['constant', 'linear_ramp'] | Literal['maximum', 'mean', 'median', 'minimum'] | Literal['reflect', 'symmetric'] | Literal['edge', 'wrap', 'empty'] | _ModeFunc = ..., *, stat_length: _SupportsArray[dtype[integer[Any]]] | _NestedSequence[_SupportsArray[dtype[integer[Any]]]] | int | _NestedSequence[int] | None = ..., constant_values: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] = ..., end_values: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] = ..., reflect_type: Literal['odd', 'even'] = ...) -> ndarray[tuple[int], dtype[signedinteger[_32Bit | _64Bit]]]
+ colour/io/luts/lut.py:1433: note: def pad(array: list[int], pad_width: _SupportsArray[dtype[integer[Any]]] | _NestedSequence[_SupportsArray[dtype[integer[Any]]]] | int | _NestedSequence[int] | dict[int, int] | dict[int, tuple[int, int]] | dict[int, int | tuple[int, int]], mode: Literal['constant', 'linear_ramp'] | Literal['maximum', 'mean', 'median', 'minimum'] | Literal['reflect', 'symmetric'] | Literal['edge', 'wrap', 'empty'] | _ModeFunc = ..., *, stat_length: _SupportsArray[dtype[integer[Any]]] | _NestedSequence[_SupportsArray[dtype[integer[Any]]]] | int | _NestedSequence[int] | None = ..., constant_values: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] = ..., end_values: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] = ..., reflect_type: Literal['odd', 'even'] = ...) -> ndarray[tuple[int], dtype[int64]]
- colour/io/luts/lut.py:1433: note: def pad(array: Sequence[list[int]], pad_width: _SupportsArray[dtype[integer[Any]]] | _NestedSequence[_SupportsArray[dtype[integer[Any]]]] | int | _NestedSequence[int] | dict[int, int] | dict[int, tuple[int, int]] | dict[int, int | tuple[int, int]], mode: Literal['constant', 'linear_ramp'] | Literal['maximum', 'mean', 'median', 'minimum'] | Literal['reflect', 'symmetric'] | Literal['edge', 'wrap', 'empty'] | _ModeFunc = ..., *, stat_length: _SupportsArray[dtype[integer[Any]]] | _NestedSequence[_SupportsArray[dtype[integer[Any]]]] | int | _NestedSequence[int] | None = ..., constant_values: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] = ..., end_values: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] = ..., reflect_type: Literal['odd', 'even'] = ...) -> ndarray[tuple[int, int], dtype[signedinteger[_32Bit | _64Bit]]]
+ colour/io/luts/lut.py:1433: note: def pad(array: Sequence[list[int]], pad_width: _SupportsArray[dtype[integer[Any]]] | _NestedSequence[_SupportsArray[dtype[integer[Any]]]] | int | _NestedSequence[int] | dict[int, int] | dict[int, tuple[int, int]] | dict[int, int | tuple[int, int]], mode: Literal['constant', 'linear_ramp'] | Literal['maximum', 'mean', 'median', 'minimum'] | Literal['reflect', 'symmetric'] | Literal['edge', 'wrap', 'empty'] | _ModeFunc = ..., *, stat_length: _SupportsArray[dtype[integer[Any]]] | _NestedSequence[_SupportsArray[dtype[integer[Any]]]] | int | _NestedSequence[int] | None = ..., constant_values: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] = ..., end_values: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] = ..., reflect_type: Literal['odd', 'even'] = ...) -> ndarray[tuple[int, int], dtype[int64]]
- colour/io/luts/lut.py:1948: error: Argument "dtype" to "as_array" has incompatible type "type[object]"; expected "type[numpy.bool[builtins.bool]] | type[signedinteger[_8Bit]] | type[signedinteger[_16Bit]] | type[signedinteger[_32Bit]] | type[signedinteger[_64Bit]] | <9 more items> | None" [arg-type]
+ colour/io/luts/lut.py:1948: error: Argument "dtype" to "as_array" has incompatible type "type[object]"; expected "type[numpy.bool[builtins.bool]] | type[int8] | type[int16] | type[int32] | type[int64] | <9 more items> | None" [arg-type]
- colour/geometry/primitives.py:239: error: Argument 2 to "zeros" has incompatible type "list[tuple[str, type[floating[_16Bit]] | type[floating[_32Bit]] | type[float64], int]]"; expected "type[signedinteger[_8Bit]] | type[signedinteger[_16Bit]] | type[signedinteger[_32Bit]] | type[signedinteger[_64Bit]] | type[unsignedinteger[_8Bit]] | <6 more items> | None" [arg-type]
- colour/geometry/primitives.py:449: error: Argument 2 to "zeros" has incompatible type "list[tuple[str, type[floating[_16Bit]] | type[floating[_32Bit]] | type[float64], int]]"; expected "type[signedinteger[_8Bit]] | type[signedinteger[_16Bit]] | type[signedinteger[_32Bit]] | type[signedinteger[_64Bit]] | type[unsignedinteger[_8Bit]] | <6 more items> | None" [arg-type]
- colour/corresponding/datasets/breneman1987.py:153: error: Argument 4 to "BrenemanExperimentResult" has incompatible type "ndarray[tuple[int], dtype[signedinteger[_32Bit | _64Bit]]]"; expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]] | None" [arg-type]
- colour/corresponding/datasets/breneman1987.py:154: error: Argument 5 to "BrenemanExperimentResult" has incompatible type "ndarray[tuple[int], dtype[signedinteger[_32Bit | _64Bit]]]"; expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]] | None" [arg-type]
- colour/corresponding/datasets/breneman1987.py:155: error: Argument 6 to "BrenemanExperimentResult" has incompatible type "ndarray[tuple[int], dtype[signedinteger[_32Bit | _64Bit]]]"; expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]] | None" [arg-type]
- colour/corresponding/datasets/breneman1987.py:161: error: Argument 4 to "BrenemanExperimentResult" has incompatible type "ndarray[tuple[int], dtype[signedinteger[_32Bit | _64Bit]]]"; expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]] | None" [arg-type]
- colour/corresponding/datasets/breneman1987.py:162: error: Argument 5 to "BrenemanExperimentResult" has incompatible type "ndarray[tuple[int], dtype[signedinteger[_32Bit | _64Bit]]]"; expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]] | None" [arg-type]
- colour/corresponding/datasets/breneman1987.py:163: error: Argument 6 to "BrenemanExperimentResult" has incompatible type "ndarray[tuple[int], dtype[signedinteger[_32Bit | _64Bit]]]"; expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]] | None" [arg-type]
- colour/corresponding/datasets/breneman1987.py:169: error: Argument 4 to "BrenemanExperimentResult" has incompatible type "ndarray[tuple[int], dtype[signedinteger[_32Bit | _64Bit]]]"; expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]] | None" [arg-type]
... (truncated 979 lines) ...
spark (https://github.com/apache/spark)
- python/pyspark/sql/pandas/types.py:1060: note: def astype(self, dtype: Literal['int', 'Int8', 'Int16', 'Int32', 'Int64', 'b', 'i1', 'int8', 'byte', 'h', 'i2', 'int16', 'short', 'i', 'i4', 'int32', 'intc', 'l', 'long', 'i8', 'int64', 'int_', 'q', 'longlong', 'p', 'intp', 'int8[pyarrow]', 'int16[pyarrow]', 'int32[pyarrow]', 'int64[pyarrow]', 'UInt8', 'UInt16', 'UInt32', 'UInt64', 'B', 'u1', 'uint8', 'ubyte', 'H', 'u2', 'uint16', 'ushort', 'I', 'u4', 'uint32', 'uintc', 'L', 'ulong', 'u8', 'uint', 'uint64', 'Q', 'ulonglong', 'P', 'uintp', 'uint8[pyarrow]', 'uint16[pyarrow]', 'uint32[pyarrow]', 'uint64[pyarrow]'] | type[int] | Int8Dtype | Int16Dtype | Int32Dtype | Int64Dtype | <14 more items>, errors: Literal['ignore', 'raise'] = ...) -> Series[int]
+ python/pyspark/sql/pandas/types.py:1060: note: def astype(self, dtype: Literal['int', 'Int8', 'Int16', 'Int32', 'Int64', 'b', 'i1', 'int8', 'byte', 'h', 'i2', 'int16', 'short', 'i', 'i4', 'int32', 'intc', 'l', 'long', 'i8', 'int64', 'int_', 'q', 'longlong', 'p', 'intp', 'int8[pyarrow]', 'int16[pyarrow]', 'int32[pyarrow]', 'int64[pyarrow]', 'UInt8', 'UInt16', 'UInt32', 'UInt64', 'B', 'u1', 'uint8', 'ubyte', 'H', 'u2', 'uint16', 'ushort', 'I', 'u4', 'uint32', 'uintc', 'L', 'ulong', 'u8', 'uint', 'uint64', 'Q', 'ulonglong', 'P', 'uintp', 'uint8[pyarrow]', 'uint16[pyarrow]', 'uint32[pyarrow]', 'uint64[pyarrow]'] | type[int] | Int8Dtype | Int16Dtype | Int32Dtype | Int64Dtype | <12 more items>, errors: Literal['ignore', 'raise'] = ...) -> Series[int]
- python/pyspark/sql/pandas/types.py:1060: note: def astype(self, dtype: type[float] | Literal['float'] | Literal['Float32', 'Float64'] | Float32Dtype | Float64Dtype | Literal['e', 'f2', '<f2', 'float16', 'half'] | type[floating[_16Bit]] | Literal['f', 'f4', 'float32', 'single', 'd', 'f8', 'float64', 'double', 'g', 'f16', 'float128', 'longdouble'] | type[floating[_32Bit]] | type[float64] | type[floating[_64Bit | _96Bit | _128Bit]] | Literal['float[pyarrow]', 'double[pyarrow]', 'float16[pyarrow]', 'float32[pyarrow]', 'float64[pyarrow]'], errors: Literal['ignore', 'raise'] = ...) -> Series[float]
+ python/pyspark/sql/pandas/types.py:1060: note: def astype(self, dtype: type[float] | Literal['float'] | Literal['Float32', 'Float64'] | Float32Dtype | Float64Dtype | Literal['e', 'f2', '<f2', 'float16', 'half'] | type[float16] | Literal['f', 'f4', 'float32', 'single', 'd', 'f8', 'float64', 'double', 'g', 'f16', 'float128', 'longdouble'] | type[float32] | type[float64] | type[longdouble] | Literal['float[pyarrow]', 'double[pyarrow]', 'float16[pyarrow]', 'float32[pyarrow]', 'float64[pyarrow]'], errors: Literal['ignore', 'raise'] = ...) -> Series[float]
- python/pyspark/sql/pandas/types.py:1060: note: def astype(self, dtype: type[complex] | Literal['complex'] | Literal['F', 'c8', 'complex64', 'csingle', 'D', 'c16', 'complex128', 'cdouble', 'G', 'c32', 'complex256', 'clongdouble'] | type[complexfloating[_32Bit, _32Bit]] | type[complex128] | type[complexfloating[_64Bit | _96Bit | _128Bit, _64Bit | _96Bit | _128Bit]], errors: Literal['ignore', 'raise'] = ...) -> Series[complex]
+ python/pyspark/sql/pandas/types.py:1060: note: def astype(self, dtype: type[complex] | Literal['complex'] | Literal['F', 'c8', 'complex64', 'csingle', 'D', 'c16', 'complex128', 'cdouble', 'G', 'c32', 'complex256', 'clongdouble'] | type[complex64] | type[complex128] | type[clongdouble], errors: Literal['ignore', 'raise'] = ...) -> Series[complex]
- python/pyspark/sql/pandas/types.py:1062: note: def astype(self, dtype: Literal['int', 'Int8', 'Int16', 'Int32', 'Int64', 'b', 'i1', 'int8', 'byte', 'h', 'i2', 'int16', 'short', 'i', 'i4', 'int32', 'intc', 'l', 'long', 'i8', 'int64', 'int_', 'q', 'longlong', 'p', 'intp', 'int8[pyarrow]', 'int16[pyarrow]', 'int32[pyarrow]', 'int64[pyarrow]', 'UInt8', 'UInt16', 'UInt32', 'UInt64', 'B', 'u1', 'uint8', 'ubyte', 'H', 'u2', 'uint16', 'ushort', 'I', 'u4', 'uint32', 'uintc', 'L', 'ulong', 'u8', 'uint', 'uint64', 'Q', 'ulonglong', 'P', 'uintp', 'uint8[pyarrow]', 'uint16[pyarrow]', 'uint32[pyarrow]', 'uint64[pyarrow]'] | type[int] | Int8Dtype | Int16Dtype | Int32Dtype | Int64Dtype | <14 more items>, errors: Literal['ignore', 'raise'] = ...) -> Series[int]
... (truncated 107 lines) ...``` |
Member
Author
|
After removing the mypy_primer diff lines where only the error message changed, here's what's left: pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/groupby/ops.py:900: error: Argument 2 to "_ob_index_and_ids" of "BaseGrouper" has incompatible type "list[ndarray[tuple[Any, ...], dtype[signedinteger[Any]]]]"; expected "list[ndarray[tuple[Any, ...], dtype[int64]]]" [arg-type]
+ pandas/core/groupby/ops.py:903: error: Argument 2 to "_unob_index_and_ids" of "BaseGrouper" has incompatible type "list[ndarray[tuple[Any, ...], dtype[signedinteger[Any]]]]"; expected "list[ndarray[tuple[Any, ...], dtype[int64]]]" [arg-type]
+ pandas/core/groupby/ops.py:912: error: List comprehension has incompatible type List[ndarray[tuple[Any, ...], dtype[signedinteger[Any]]]]; expected List[ndarray[tuple[Any, ...], dtype[int64]]] [misc]
+ pandas/core/groupby/ops.py:918: error: List comprehension has incompatible type List[ndarray[tuple[Any, ...], dtype[signedinteger[Any]]]]; expected List[ndarray[tuple[Any, ...], dtype[int64]]] [misc]
+ pandas/core/groupby/ops.py:1392: error: Signature of "codes" incompatible with supertype "BaseGrouper" [override]
colour (https://github.com/colour-science/colour)
+ colour/plotting/colorimetry.py:567: error: No overload variant of "__sub__" of "float16" matches argument type "timedelta64[Any]" [operator]
+ colour/plotting/colorimetry.py:567: error: No overload variant of "__sub__" of "float32" matches argument type "timedelta64[Any]" [operator]
+ colour/plotting/colorimetry.py:567: error: No overload variant of "__sub__" of "float64" matches argument type "timedelta64[Any]" [operator]
+ colour/plotting/colorimetry.py:567: error: Value of type variable "T" of "__call__" of "_ufunc_11_bifcmo" cannot be "number[Any, Any] | numpy.bool[builtins.bool] | timedelta64[Any] | datetime64[Any]" [type-var]
+ colour/plotting/colorimetry.py:567: error: Unsupported operand types for * ("datetime64[Any]" and "float") [operator]
+ colour/plotting/colorimetry.py:568: error: No overload variant of "__add__" of "float16" matches argument type "timedelta64[Any]" [operator]
+ colour/plotting/colorimetry.py:568: error: No overload variant of "__add__" of "float32" matches argument type "timedelta64[Any]" [operator]
+ colour/plotting/colorimetry.py:568: error: No overload variant of "__add__" of "float64" matches argument type "timedelta64[Any]" [operator]
+ colour/plotting/colorimetry.py:568: error: Value of type variable "T" of "__call__" of "_ufunc_11_bifcmo" cannot be "number[Any, Any] | numpy.bool[builtins.bool] | timedelta64[Any] | datetime64[Any]" [type-var]
+ colour/plotting/colorimetry.py:568: error: Unsupported operand types for * ("datetime64[Any]" and "float") [operator]
tldr; I expected more errors, but it turns out I was wrong (at least for this mypy_primer corpus), so that's a relief. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This has been a long standing issue in the stubs, was causing issues for several typecheckers (at least mypy, pyright, and ty, see e.g. astral-sh/ty#116 and astral-sh/ty#4727), and prevented us from accurately typing arithmetic operations on the numpy scalars.
All subclasses of
unsignedinteger,signedinteger,floating, andcomplexfloatingare now typed as now concrete classes in the stubs. Their operator dunders (__add__,__sub__, etc) are now also precisely typed to accurately reflect NEP 50 scalar promotion rules, resolving a bunch ofAny's, annoying unions and other wide types, and even some incorrect results (e.g. or combinations of signed and unsigned integers promoting tofloat64).This might cause some previously-hidden downstream typing issues to surface, because the nominal scalar type hierarchy is now enforced. For example
np.integerused to be assignable tonp.int64, but that is now no longer the case (because it's unsound), causing type-checkers to reject such attempts (as they should).The stubs now makes the following assumptions:
intp == int64anduintp == uint64(since the vast majority of users will use a 64-bit system)[u]intc == [u]int32,[u]short == [u]int16, and[u]byte == [u]int8[u]longis[u]int32ifsys.platform == "win32"and otherwise[u]int64[u]longlong == [u]int64longdouble == float96 == float128andclongdouble == complex192 == complex256(both sized aliases have to be available in the stubs to avoid "but it worked on my machine" scenarios).For exotic systems where this doesn't hold, the worst that might happen is a squiggly line if they're unlucky, but they probably won't even notice.
This closes #23007, and indirectly also closes #28838.
AI did the mechanical work, but most of this was me.