[ty] Support partially specialized type context for collection literals by ibraheemdev · Pull Request #24506 · astral-sh/ruff (original) (raw)
ecosystem-analyzer results
| Lint rule | Added | Removed | Changed |
|---|---|---|---|
| invalid-argument-type | 0 | 3 | 30 |
| unresolved-attribute | 0 | 0 | 9 |
| no-matching-overload | 0 | 3 | 0 |
| not-iterable | 0 | 0 | 2 |
| type-assertion-failure | 0 | 2 | 0 |
| invalid-assignment | 0 | 0 | 1 |
| Total | 0 | 8 | 42 |
Raw diff (50 changes)
colour (https://github.com/colour-science/colour)
- colour/models/rgb/tests/test_rgb_colourspace.py:346:17 error[invalid-argument-type] Argument to function
XYZ_to_RGBis incorrect: ExpectedRGB_Colourspace | str, foundndarray[tuple[Any, ...], dtype[Any]]
- colour/models/rgb/tests/test_rgb_colourspace.py:346:17 error[invalid-argument-type] Argument to function
XYZ_to_RGBis incorrect: ExpectedRGB_Colourspace | str, foundndarray[tuple[Any, ...], dtype[Unknown]]
- colour/models/rgb/tests/test_rgb_colourspace.py:348:17 error[invalid-argument-type] Argument to function
XYZ_to_RGBis incorrect: Expectedstr | None, foundndarray[tuple[Any, ...], dtype[Any]]
- colour/models/rgb/tests/test_rgb_colourspace.py:348:17 error[invalid-argument-type] Argument to function
XYZ_to_RGBis incorrect: Expectedstr | None, foundndarray[tuple[Any, ...], dtype[Unknown]]
- colour/models/rgb/tests/test_rgb_colourspace.py:365:17 error[invalid-argument-type] Argument to function
XYZ_to_RGBis incorrect: ExpectedRGB_Colourspace | str, foundndarray[tuple[Any, ...], dtype[Any]]
- colour/models/rgb/tests/test_rgb_colourspace.py:365:17 error[invalid-argument-type] Argument to function
XYZ_to_RGBis incorrect: ExpectedRGB_Colourspace | str, foundndarray[tuple[Any, ...], dtype[Unknown]]
- colour/models/rgb/tests/test_rgb_colourspace.py:367:17 error[invalid-argument-type] Argument to function
XYZ_to_RGBis incorrect: Expectedstr | None, foundndarray[tuple[Any, ...], dtype[Any]]
- colour/models/rgb/tests/test_rgb_colourspace.py:367:17 error[invalid-argument-type] Argument to function
XYZ_to_RGBis incorrect: Expectedstr | None, foundndarray[tuple[Any, ...], dtype[Unknown]]
- colour/models/rgb/tests/test_rgb_colourspace.py:384:17 error[invalid-argument-type] Argument to function
XYZ_to_RGBis incorrect: ExpectedRGB_Colourspace | str, foundndarray[tuple[Any, ...], dtype[Any]]
- colour/models/rgb/tests/test_rgb_colourspace.py:384:17 error[invalid-argument-type] Argument to function
XYZ_to_RGBis incorrect: ExpectedRGB_Colourspace | str, foundndarray[tuple[Any, ...], dtype[Unknown]]
- colour/models/rgb/tests/test_rgb_colourspace.py:386:17 error[invalid-argument-type] Argument to function
XYZ_to_RGBis incorrect: Expectedstr | None, foundndarray[tuple[Any, ...], dtype[Any]]
- colour/models/rgb/tests/test_rgb_colourspace.py:386:17 error[invalid-argument-type] Argument to function
XYZ_to_RGBis incorrect: Expectedstr | None, foundndarray[tuple[Any, ...], dtype[Unknown]]
- colour/models/rgb/tests/test_rgb_colourspace.py:401:17 error[invalid-argument-type] Argument to function
XYZ_to_RGBis incorrect: ExpectedRGB_Colourspace | str, foundndarray[tuple[Any, ...], dtype[Any]]
- colour/models/rgb/tests/test_rgb_colourspace.py:401:17 error[invalid-argument-type] Argument to function
XYZ_to_RGBis incorrect: ExpectedRGB_Colourspace | str, foundndarray[tuple[Any, ...], dtype[Unknown]]
- colour/models/rgb/tests/test_rgb_colourspace.py:403:17 error[invalid-argument-type] Argument to function
XYZ_to_RGBis incorrect: Expectedstr | None, foundndarray[tuple[Any, ...], dtype[Any]]
- colour/models/rgb/tests/test_rgb_colourspace.py:403:17 error[invalid-argument-type] Argument to function
XYZ_to_RGBis incorrect: Expectedstr | None, foundndarray[tuple[Any, ...], dtype[Unknown]]
- colour/models/rgb/tests/test_rgb_colourspace.py:546:17 error[invalid-argument-type] Argument to function
RGB_to_XYZis incorrect: ExpectedRGB_Colourspace | str, foundndarray[tuple[Any, ...], dtype[Any]]
- colour/models/rgb/tests/test_rgb_colourspace.py:546:17 error[invalid-argument-type] Argument to function
RGB_to_XYZis incorrect: ExpectedRGB_Colourspace | str, foundndarray[tuple[Any, ...], dtype[Unknown]]
- colour/models/rgb/tests/test_rgb_colourspace.py:548:17 error[invalid-argument-type] Argument to function
RGB_to_XYZis incorrect: Expectedstr | None, foundndarray[tuple[Any, ...], dtype[Any]]
- colour/models/rgb/tests/test_rgb_colourspace.py:548:17 error[invalid-argument-type] Argument to function
RGB_to_XYZis incorrect: Expectedstr | None, foundndarray[tuple[Any, ...], dtype[Unknown]]
- colour/models/rgb/tests/test_rgb_colourspace.py:565:17 error[invalid-argument-type] Argument to function
RGB_to_XYZis incorrect: ExpectedRGB_Colourspace | str, foundndarray[tuple[Any, ...], dtype[Any]]
- colour/models/rgb/tests/test_rgb_colourspace.py:565:17 error[invalid-argument-type] Argument to function
RGB_to_XYZis incorrect: ExpectedRGB_Colourspace | str, foundndarray[tuple[Any, ...], dtype[Unknown]]
- colour/models/rgb/tests/test_rgb_colourspace.py:567:17 error[invalid-argument-type] Argument to function
RGB_to_XYZis incorrect: Expectedstr | None, foundndarray[tuple[Any, ...], dtype[Any]]
- colour/models/rgb/tests/test_rgb_colourspace.py:567:17 error[invalid-argument-type] Argument to function
RGB_to_XYZis incorrect: Expectedstr | None, foundndarray[tuple[Any, ...], dtype[Unknown]]
- colour/models/rgb/tests/test_rgb_colourspace.py:584:17 error[invalid-argument-type] Argument to function
RGB_to_XYZis incorrect: ExpectedRGB_Colourspace | str, foundndarray[tuple[Any, ...], dtype[Any]]
- colour/models/rgb/tests/test_rgb_colourspace.py:584:17 error[invalid-argument-type] Argument to function
RGB_to_XYZis incorrect: ExpectedRGB_Colourspace | str, foundndarray[tuple[Any, ...], dtype[Unknown]]
- colour/models/rgb/tests/test_rgb_colourspace.py:586:17 error[invalid-argument-type] Argument to function
RGB_to_XYZis incorrect: Expectedstr | None, foundndarray[tuple[Any, ...], dtype[Any]]
- colour/models/rgb/tests/test_rgb_colourspace.py:586:17 error[invalid-argument-type] Argument to function
RGB_to_XYZis incorrect: Expectedstr | None, foundndarray[tuple[Any, ...], dtype[Unknown]]
- colour/models/rgb/tests/test_rgb_colourspace.py:601:17 error[invalid-argument-type] Argument to function
RGB_to_XYZis incorrect: ExpectedRGB_Colourspace | str, foundndarray[tuple[Any, ...], dtype[Any]]
- colour/models/rgb/tests/test_rgb_colourspace.py:601:17 error[invalid-argument-type] Argument to function
RGB_to_XYZis incorrect: ExpectedRGB_Colourspace | str, foundndarray[tuple[Any, ...], dtype[Unknown]]
- colour/models/rgb/tests/test_rgb_colourspace.py:603:17 error[invalid-argument-type] Argument to function
RGB_to_XYZis incorrect: Expectedstr | None, foundndarray[tuple[Any, ...], dtype[Any]]
- colour/models/rgb/tests/test_rgb_colourspace.py:603:17 error[invalid-argument-type] Argument to function
RGB_to_XYZis incorrect: Expectedstr | None, foundndarray[tuple[Any, ...], dtype[Unknown]]
- colour/plotting/diagrams.py:451:13 error[invalid-argument-type] Argument to
LineCollection.__init__is incorrect: ExpectedSequence[_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | ... omitted 5 union elements], foundndarray[tuple[int, int, int], dtype[Any]]
- colour/plotting/diagrams.py:451:13 error[invalid-argument-type] Argument to
LineCollection.__init__is incorrect: ExpectedSequence[_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | ... omitted 5 union elements], foundndarray[tuple[int, int, int], dtype[Unknown]]
- colour/plotting/models.py:419:13 error[invalid-argument-type] Argument to
LineCollection.__init__is incorrect: ExpectedSequence[_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | ... omitted 5 union elements], foundndarray[tuple[int, int, int], dtype[Any]]
- colour/plotting/models.py:419:13 error[invalid-argument-type] Argument to
LineCollection.__init__is incorrect: ExpectedSequence[_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | ... omitted 5 union elements], foundndarray[tuple[int, int, int], dtype[Unknown]]
- colour/plotting/temperature.py:233:9 error[invalid-argument-type] Argument to
LineCollection.__init__is incorrect: ExpectedSequence[_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | ... omitted 5 union elements], foundndarray[tuple[int, int, int], dtype[Any]]
- colour/plotting/temperature.py:233:9 error[invalid-argument-type] Argument to
LineCollection.__init__is incorrect: ExpectedSequence[_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | ... omitted 5 union elements], foundndarray[tuple[int, int, int], dtype[Unknown]]
- colour/plotting/temperature.py:479:13 error[invalid-argument-type] Argument to
LineCollection.__init__is incorrect: ExpectedSequence[_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | ... omitted 5 union elements], foundndarray[tuple[int, int, int], dtype[Any]]
- colour/plotting/temperature.py:479:13 error[invalid-argument-type] Argument to
LineCollection.__init__is incorrect: ExpectedSequence[_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | ... omitted 5 union elements], foundndarray[tuple[int, int, int], dtype[Unknown]]
meson (https://github.com/mesonbuild/meson)
- mesonbuild/interpreter/type_checking.py:1043:9 error[invalid-argument-type] Argument to
KwargInfo.__init__is incorrect: Expecteddict[str | ContainerTypeInfo | type, str | tuple[str, str]] | None, founddict[str, str] - mesonbuild/interpreter/type_checking.py:1046:9 error[invalid-argument-type] Argument to
KwargInfo.__init__is incorrect: Expecteddict[str | ContainerTypeInfo | type, str | tuple[str, str]] | None, founddict[str, tuple[str, str]] - mesonbuild/interpreter/type_checking.py:1093:5 error[invalid-argument-type] Argument to
KwargInfo.__init__is incorrect: Expecteddict[str | ContainerTypeInfo | type, str | tuple[str, str]] | None, founddict[str, tuple[str, str]]
pandas (https://github.com/pandas-dev/pandas)
- pandas/tests/arithmetic/test_object.py:385:31 error[invalid-argument-type] Argument to function
assert_index_equalis incorrect: ExpectedIndex, foundndarray[tuple[Any, ...], dtype[Any]]
- pandas/tests/arithmetic/test_object.py:385:31 error[invalid-argument-type] Argument to function
assert_index_equalis incorrect: ExpectedIndex, foundndarray[tuple[Any, ...], dtype[Unknown]]
- pandas/tests/dtypes/test_common.py:557:40 error[invalid-argument-type] Argument to function
needs_i8_conversionis incorrect: Expecteddtype[Any] | ExtensionDtype | None, foundndarray[tuple[Any, ...], dtype[Any]]
- pandas/tests/dtypes/test_common.py:557:40 error[invalid-argument-type] Argument to function
needs_i8_conversionis incorrect: Expecteddtype[Any] | ExtensionDtype | None, foundndarray[tuple[Any, ...], dtype[Unknown]]
- pandas/tests/frame/methods/test_isin.py:217:26 error[invalid-argument-type] Argument to bound method
DataFrame.isinis incorrect: ExpectedSeries | DataFrame | Sequence[Unknown] | Mapping[Unknown, Unknown], foundndarray[tuple[Any, ...], dtype[Any]]
- pandas/tests/frame/methods/test_isin.py:217:26 error[invalid-argument-type] Argument to bound method
DataFrame.isinis incorrect: ExpectedSeries | DataFrame | Sequence[Unknown] | Mapping[Unknown, Unknown], foundndarray[tuple[Any, ...], dtype[Unknown]]
- pandas/tests/indexes/period/methods/test_shift.py:19:28 error[invalid-argument-type] Argument to bound method
PeriodIndex.shiftis incorrect: Expectedint, foundndarray[tuple[Any, ...], dtype[Any]]
- pandas/tests/indexes/period/methods/test_shift.py:19:28 error[invalid-argument-type] Argument to bound method
PeriodIndex.shiftis incorrect: Expectedint, foundndarray[tuple[Any, ...], dtype[Unknown]]
- pandas/tests/indexes/period/methods/test_shift.py:25:28 error[invalid-argument-type] Argument to bound method
PeriodIndex.shiftis incorrect: Expectedint, foundndarray[tuple[Any, ...], dtype[Any]]
- pandas/tests/indexes/period/methods/test_shift.py:25:28 error[invalid-argument-type] Argument to bound method
PeriodIndex.shiftis incorrect: Expectedint, foundndarray[tuple[Any, ...], dtype[Unknown]]
- pandas/tests/io/pytables/test_store.py:298:44 error[invalid-argument-type] Argument is incorrect: Expected
DataFrame, foundDataFrame | Series | ndarray[tuple[Any, ...], dtype[Any]]
- pandas/tests/io/pytables/test_store.py:298:44 error[invalid-argument-type] Argument is incorrect: Expected
DataFrame, foundDataFrame | Series | ndarray[tuple[Any, ...], dtype[Unknown]]
- pandas/tests/io/pytables/test_store.py:300:45 error[invalid-argument-type] Argument is incorrect: Expected
Series, foundDataFrame | Series | ndarray[tuple[Any, ...], dtype[Any]]
- pandas/tests/io/pytables/test_store.py:300:45 error[invalid-argument-type] Argument is incorrect: Expected
Series, foundDataFrame | Series | ndarray[tuple[Any, ...], dtype[Unknown]]
pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
- tests/test_pandas.py:142:9 error[type-assertion-failure] Type
Unknowndoes not match asserted typeNever - tests/test_pandas.py:145:9 error[type-assertion-failure] Type
Unknowndoes not match asserted typeNever
scikit-learn (https://github.com/scikit-learn/scikit-learn)
- sklearn/utils/tests/test_multiclass.py:450:27 error[unresolved-attribute] Attribute
toarrayis not defined onlist[list[int]] & SparseABC,ndarray[tuple[Any, ...], dtype[Any]] & SparseABC,_NotAnArray & SparseABC,list[int] & SparseABC,list[str] & SparseABC,list[list[str]] & SparseABC,list[Unknown] & SparseABC,list[int | float] & SparseABC,list[list[Unknown]] & SparseABC,list[tuple[()]] & SparseABC,list[ndarray[tuple[Any, ...], dtype[Unknown]]] & SparseABC,list[set[int]] & SparseABC,list[frozenset[int]] & SparseABC,list[dict[int, str]] & SparseABCin union(Unknown & SparseABC) | (list[list[int]] & SparseABC) | (ndarray[tuple[Any, ...], dtype[Any]] & SparseABC) | ... omitted 12 union elements
- sklearn/utils/tests/test_multiclass.py:450:27 error[unresolved-attribute] Attribute
toarrayis not defined onlist[list[int]] & SparseABC,ndarray[tuple[Any, ...], dtype[Unknown]] & SparseABC,_NotAnArray & SparseABC,list[int] & SparseABC,list[str] & SparseABC,list[list[str]] & SparseABC,list[Unknown] & SparseABC,list[int | float] & SparseABC,list[list[Unknown]] & SparseABC,list[tuple[()]] & SparseABC,list[ndarray[tuple[Any, ...], dtype[Unknown]]] & SparseABC,list[set[int]] & SparseABC,list[frozenset[int]] & SparseABC,list[dict[int, str]] & SparseABCin union(Unknown & SparseABC) | (list[list[int]] & SparseABC) | (ndarray[tuple[Any, ...], dtype[Unknown]] & SparseABC) | ... omitted 12 union elements
- sklearn/utils/validation.py:2527:8 error[unresolved-attribute] Attribute
sizeis not defined onNonein unionndarray[tuple[Any, ...], dtype[Any]] | None
- sklearn/utils/validation.py:2527:8 error[unresolved-attribute] Attribute
sizeis not defined onNonein unionndarray[tuple[Any, ...], dtype[Unknown]] | None
- sklearn/utils/validation.py:2530:8 error[unresolved-attribute] Attribute
dtypeis not defined onNonein unionndarray[tuple[Any, ...], dtype[Any]] | None
- sklearn/utils/validation.py:2530:8 error[unresolved-attribute] Attribute
dtypeis not defined onNonein unionndarray[tuple[Any, ...], dtype[Unknown]] | None
- sklearn/utils/validation.py:2533:26 error[unresolved-attribute] Attribute
dtypeis not defined onNonein unionndarray[tuple[Any, ...], dtype[Any]] | None
- sklearn/utils/validation.py:2533:26 error[unresolved-attribute] Attribute
dtypeis not defined onNonein unionndarray[tuple[Any, ...], dtype[Unknown]] | None
- sklearn/utils/validation.py:2536:8 error[unresolved-attribute] Attribute
dtypeis not defined onNonein unionndarray[tuple[Any, ...], dtype[Any]] | None
- sklearn/utils/validation.py:2536:8 error[unresolved-attribute] Attribute
dtypeis not defined onNonein unionndarray[tuple[Any, ...], dtype[Unknown]] | None
- sklearn/utils/validation.py:2537:38 error[not-iterable] Object of type
ndarray[tuple[Any, ...], dtype[Any]] | Nonemay not be iterable
- sklearn/utils/validation.py:2537:38 error[not-iterable] Object of type
ndarray[tuple[Any, ...], dtype[Unknown]] | Nonemay not be iterable
- sklearn/utils/validation.py:2550:8 error[unresolved-attribute] Attribute
dtypeis not defined onNonein unionndarray[tuple[Any, ...], dtype[Any]] | None
- sklearn/utils/validation.py:2550:8 error[unresolved-attribute] Attribute
dtypeis not defined onNonein unionndarray[tuple[Any, ...], dtype[Unknown]] | None
- sklearn/utils/validation.py:2560:29 error[not-iterable] Object of type
ndarray[tuple[Any, ...], dtype[Any]] | Nonemay not be iterable
- sklearn/utils/validation.py:2560:29 error[not-iterable] Object of type
ndarray[tuple[Any, ...], dtype[Unknown]] | Nonemay not be iterable
- sklearn/utils/validation.py:2569:10 error[unresolved-attribute] Attribute
dtypeis not defined onNonein unionndarray[tuple[Any, ...], dtype[Any]] | None
- sklearn/utils/validation.py:2569:10 error[unresolved-attribute] Attribute
dtypeis not defined onNonein unionndarray[tuple[Any, ...], dtype[Unknown]] | None
- sklearn/utils/validation.py:2582:12 error[unresolved-attribute] Attribute
shapeis not defined onNonein unionndarray[tuple[Any, ...], dtype[Any]] | None
- sklearn/utils/validation.py:2582:12 error[unresolved-attribute] Attribute
shapeis not defined onNonein unionndarray[tuple[Any, ...], dtype[Unknown]] | None
- sklearn/utils/validation.py:2586:20 error[unresolved-attribute] Attribute
shapeis not defined onNonein unionndarray[tuple[Any, ...], dtype[Any]] | None
- sklearn/utils/validation.py:2586:20 error[unresolved-attribute] Attribute
shapeis not defined onNonein unionndarray[tuple[Any, ...], dtype[Unknown]] | None
scipy (https://github.com/scipy/scipy)
- subprojects/cobyqa/examples/powell1994.py:91:23 error[no-matching-overload] No overload of function
blockmatches arguments - scipy/interpolate/tests/test_interpnd.py:467:14 error[no-matching-overload] No overload of function
blockmatches arguments - scipy/optimize/tests/test_constraint_conversion.py:205:49 error[invalid-argument-type] Argument to function
assert_array_almost_equalis incorrect: Expected_SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]]] | int | ... omitted 5 union elements, foundndarray[tuple[Any, ...], dtype[Any]] | list[int | float] | Unknown | None
- scipy/optimize/tests/test_constraint_conversion.py:205:49 error[invalid-argument-type] Argument to function
assert_array_almost_equalis incorrect: Expected_SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]]] | int | ... omitted 5 union elements, foundndarray[tuple[Any, ...], dtype[Unknown]] | list[int | float] | Unknown | None
- scipy/spatial/tests/test_qhull.py:116:5 error[invalid-assignment] Invalid subscript assignment with key of type
strand value of typetuple[list[ndarray[tuple[Any, ...], dtype[Any]] | ndarray[tuple[Any, ...], dtype[float64]]], None | Literal["QJ Pp"]]on object of typedict[str, tuple[list[ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[Any, ...], dtype[Any]]], None] | tuple[Unknown, None]]
- scipy/spatial/tests/test_qhull.py:116:5 error[invalid-assignment] Invalid subscript assignment with key of type
strand value of typetuple[list[ndarray[tuple[Any, ...], dtype[Any]] | ndarray[tuple[Any, ...], dtype[float64]]], None | Literal["QJ Pp"]]on object of typedict[str, tuple[list[ndarray[tuple[Any, ...], dtype[float64]] | ndarray[tuple[Any, ...], dtype[Unknown]]], None] | tuple[Unknown, None]]
- subprojects/pyprima/pyprima/pyprima/src/pyprima/common/linalg.py:368:11 error[no-matching-overload] No overload of function
amaxmatches arguments
xarray (https://github.com/pydata/xarray)
- xarray/tests/test_typed_ops.py:28:11 error[invalid-argument-type] Argument to function
_testis incorrect: ExpectedVariable, foundndarray[tuple[Any, ...], dtype[Any]]
- xarray/tests/test_typed_ops.py:28:11 error[invalid-argument-type] Argument to function
_testis incorrect: ExpectedVariable, foundndarray[tuple[Any, ...], dtype[Unknown]]
- xarray/tests/test_typed_ops.py:79:11 error[invalid-argument-type] Argument to function
_testis incorrect: ExpectedDataArray, foundndarray[tuple[Any, ...], dtype[Any]]
- xarray/tests/test_typed_ops.py:79:11 error[invalid-argument-type] Argument to function
_testis incorrect: ExpectedDataArray, foundndarray[tuple[Any, ...], dtype[Unknown]]