Thanks to visit codestin.com
Credit goes to github.com

Skip to content

TYP: Workaround for a mypy issue in ndarray.__iter__ #29218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2025

Conversation

jorenham
Copy link
Member

Closes #29214


The workaround I had in mind was also bugged, so I suppose that'd make it a workaroundaround. And just like that term, this workaroundaround itself also looks pretty absurd.

@jorenham jorenham added 09 - Backport-Candidate PRs tagged should be backported 41 - Static typing labels Jun 17, 2025
@jorenham
Copy link
Member Author

cc @JstnMcBrd

Copy link

Diff from mypy_primer, showing the effect of this PR on type check results on a corpus of open source code:

rclip (https://github.com/yurijmikhalevich/rclip)
- rclip/model.py:218: error: Argument "key" to "sorted" has incompatible type "Callable[[tuple[float64, int]], float64]"; expected "Callable[[tuple[float64, int]], SupportsDunderLT[Any] | SupportsDunderGT[Any]]"  [arg-type]
- rclip/model.py:218: error: Incompatible return value type (got "float64", expected "SupportsDunderLT[Any] | SupportsDunderGT[Any]")  [return-value]
- rclip/model.py:220: error: Incompatible return value type (got "list[tuple[float64, int]]", expected "list[tuple[float, int]]")  [return-value]
- rclip/model.py:220: note: "list" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
- rclip/model.py:220: note: Consider using "Sequence" instead, which is covariant
- rclip/model.py:220: note: Perhaps you need a type annotation for "sorted_similarities"? Suggestion: "list[tuple[float, int]]"

jax (https://github.com/google/jax)
+ jax/_src/pallas/hlo_interpreter.py:93: error: Unused "type: ignore" comment  [unused-ignore]

static-frame (https://github.com/static-frame/static-frame)
- static_frame/core/loc_map.py:428: error: Incompatible types in assignment (expression has type "unsignedinteger[_64Bit]", variable has type "ndarray[tuple[Any, ...], dtype[unsignedinteger[_64Bit]]]")  [assignment]
+ static_frame/core/container_util.py:1339: error: Unused "type: ignore" comment  [unused-ignore]

dedupe (https://github.com/dedupeio/dedupe)
- dedupe/clustering.py:59: error: Incompatible types in assignment (expression has type "signedinteger[_64Bit]", variable has type "int")  [assignment]
- dedupe/labeler.py:199: error: Generator has incompatible item type "tuple[int | str, int | str]"; expected "tuple[int, int] | tuple[str, str]"  [misc]
- dedupe/convenience.py:99: error: "signedinteger[_64Bit]" object is not iterable  [misc]
- dedupe/convenience.py:99: error: Cannot determine type of "p"  [has-type]
- dedupe/convenience.py:99: error: Cannot determine type of "q"  [has-type]

scipy (https://github.com/scipy/scipy)
- scipy/spatial/tests/test_spherical_voronoi.py:194: error: Value of type variable "SupportsRichComparisonT" of "sorted" cannot be "floating[Any]"  [type-var]

hydpy (https://github.com/hydpy-dev/hydpy)
- hydpy/core/objecttools.py:955: error: Argument 1 to "repr_values" has incompatible type "Sequence[object] | ndarray[tuple[Any, ...], dtype[generic[Any]]] | generic[Any]"; expected "Sequence[object] | ndarray[tuple[Any, ...], dtype[generic[Any]]]"  [arg-type]
- hydpy/core/netcdftools.py:489: error: Argument 1 to "join" of "bytes" has incompatible type "bytes_"; expected "Iterable[Buffer]"  [arg-type]
- hydpy/core/netcdftools.py:489: note: Following member(s) of "bytes_" have conflicts:
- hydpy/core/netcdftools.py:489: note:     Expected:
- hydpy/core/netcdftools.py:489: note:         def __iter__(self) -> Iterator[Buffer]
- hydpy/core/netcdftools.py:489: note:     Got:
- hydpy/core/netcdftools.py:489: note:         def __iter__(self) -> Iterator[int]
- hydpy/core/netcdftools.py:489: note:     Expected:
- hydpy/core/netcdftools.py:489: note:         def __iter__(self) -> Iterator[Buffer]
- hydpy/core/netcdftools.py:489: note:     Got:
- hydpy/core/netcdftools.py:489: note:         def __iter__(self) -> Iterator[int]
- hydpy/core/netcdftools.py:489: note:     Expected:
- hydpy/core/netcdftools.py:489: note:         def __iter__(self) -> Iterator[Buffer]
- hydpy/core/netcdftools.py:489: note:     Got:
- hydpy/core/netcdftools.py:489: note:         def __iter__(self) -> Iterator[int]
- hydpy/core/itemtools.py:951: error: Argument 2 to "update_variable" of "ChangeItem" has incompatible type "float64"; expected "ndarray[tuple[Any, ...], dtype[float64]]"  [arg-type]
- hydpy/core/itemtools.py:954: error: Argument 2 to "update_variable" of "ChangeItem" has incompatible type "float64"; expected "ndarray[tuple[Any, ...], dtype[float64]]"  [arg-type]
- hydpy/auxs/ppolytools.py:253: error: Value of type variable "_AnyShapeT" of "__call__" of "_ConstructorEmpty" cannot be "tuple[int, signedinteger[_64Bit]]"  [type-var]
- hydpy/auxs/ppolytools.py:253: error: Value of type variable "SupportsRichComparisonT" of "max" cannot be "signedinteger[_64Bit]"  [type-var]
- hydpy/auxs/ppolytools.py:661: error: Value of type "float64" is not indexable  [index]

spark (https://github.com/apache/spark)
- python/pyspark/sql/streaming/benchmark/utils.py:26: error: Incompatible types in string interpolation (expression has type "floating[Any]", placeholder has type "int | float")  [str-format]

pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/array_algos/quantile.py:199: error: Unused "type: ignore" comment  [unused-ignore]
+ pandas/core/sorting.py:479: error: Unused "type: ignore" comment  [unused-ignore]
- pandas/tseries/frequencies.py:274: error: List comprehension has incompatible type List[floating[_64Bit]]; expected List[int]  [misc]
- pandas/tseries/frequencies.py:279: error: List comprehension has incompatible type List[floating[_64Bit]]; expected List[int]  [misc]
- pandas/core/arrays/datetimelike.py:1293: error: No overload variant of "__mul__" of "BaseOffset" matches argument type "signedinteger[_64Bit]"  [operator]
- pandas/core/arrays/datetimelike.py:1293: note: Possible overload variants:
- pandas/core/arrays/datetimelike.py:1293: note:     def __mul__(self, ndarray[tuple[Any, ...], dtype[Any]], /) -> ndarray[tuple[Any, ...], dtype[Any]]
- pandas/core/arrays/datetimelike.py:1293: note:     def __mul__(self, int, /) -> BaseOffset
- pandas/io/stata.py:1448: error: Invalid index type "unsignedinteger[_8Bit]" for "dict[int, int]"; expected type "int"  [index]
- pandas/io/stata.py:1450: error: Argument 1 to "append" of "list" has incompatible type "unsignedinteger[_8Bit]"; expected "int"  [arg-type]
+ pandas/io/parsers/python_parser.py:1471: error: Unused "type: ignore" comment  [unused-ignore]
+ pandas/core/internals/construction.py:637: error: Unused "type: ignore" comment  [unused-ignore]
- pandas/core/internals/managers.py:972: error: Incompatible types in assignment (expression has type "signedinteger[_32Bit | _64Bit]", variable has type "int")  [assignment]
- pandas/core/internals/managers.py:1527: error: "BlockPlacement" has no attribute "increment_above"  [attr-defined]
+ pandas/core/internals/blocks.py:2101: error: Unused "type: ignore" comment  [unused-ignore]
- pandas/io/formats/style_render.py:1243: error: Invalid index type "tuple[signedinteger[_32Bit | _64Bit], signedinteger[_32Bit | _64Bit]]" for "defaultdict[tuple[int, int], Callable[[Any], str]]"; expected type "tuple[int, int]"  [index]

colour (https://github.com/colour-science/colour)
- colour/algebra/prng.py:96: error: Value of type "floating[_16Bit] | floating[_32Bit] | float64" is not indexable  [index]
- colour/algebra/prng.py:97: error: Value of type "floating[_16Bit] | floating[_32Bit] | float64" is not indexable  [index]
- colour/algebra/prng.py:98: error: Value of type "floating[_16Bit] | floating[_32Bit] | float64" is not indexable  [index]
- colour/algebra/interpolation.py:692: error: Value of type variable "SupportsRichComparisonT" of "min" cannot be "floating[_16Bit] | floating[_32Bit] | float64"  [type-var]
- colour/algebra/interpolation.py:693: error: Value of type variable "SupportsRichComparisonT" of "max" cannot be "floating[_16Bit] | floating[_32Bit] | float64"  [type-var]
- colour/algebra/interpolation.py:700: error: Value of type variable "SupportsRichComparisonT" of "min" cannot be "floating[_16Bit] | floating[_32Bit] | float64"  [type-var]
- colour/io/luts/lut.py:1450: error: Value of type "floating[_16Bit] | floating[_32Bit] | float64" is not indexable  [index]
- colour/io/luts/lut.py:1455: error: Value of type "floating[_16Bit] | floating[_32Bit] | float64" is not indexable  [index]
- colour/io/luts/lut.py:1540: error: Value of type "floating[_16Bit] | floating[_32Bit] | float64" is not indexable  [index]
- colour/io/luts/lut.py:1544: error: Value of type "floating[_16Bit] | floating[_32Bit] | float64" is not indexable  [index]
- colour/io/luts/lut.py:1550: error: Value of type "floating[_16Bit] | floating[_32Bit] | float64" is not indexable  [index]
- colour/io/luts/lut.py:1878: error: Value of type "floating[_16Bit] | floating[_32Bit] | float64" is not indexable  [index]
- colour/io/luts/lut.py:2086: error: Value of type "floating[_16Bit] | floating[_32Bit] | float64" is not indexable  [index]
- colour/io/luts/lut.py:2095: error: Incompatible types in assignment (expression has type "floating[_16Bit] | floating[_32Bit] | float64", variable has type "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]")  [assignment]
- colour/io/luts/lut.py:2095: error: Incompatible types in assignment (expression has type "floating[_16Bit] | floating[_32Bit] | float64", variable has type "list[Any]")  [assignment]
- colour/colorimetry/spectrum.py:1180: error: Value of type variable "SupportsRichComparisonT" of "max" cannot be "int | float | floating[_16Bit] | floating[_32Bit]"  [type-var]
- colour/colorimetry/spectrum.py:1180: error: Incompatible types in assignment (expression has type "int | float | floating[_16Bit] | floating[_32Bit]", variable has type "int | float")  [assignment]
- colour/colorimetry/spectrum.py:1181: error: Value of type variable "SupportsRichComparisonT" of "min" cannot be "int | float | floating[_16Bit] | floating[_32Bit]"  [type-var]
- colour/colorimetry/spectrum.py:1181: error: Incompatible types in assignment (expression has type "int | float | floating[_16Bit] | floating[_32Bit]", variable has type "int | float")  [assignment]
- colour/colorimetry/spectrum.py:1611: error: Value of type variable "SupportsRichComparisonT" of "max" cannot be "floating[_16Bit] | floating[_32Bit] | float64"  [type-var]
- colour/colorimetry/generation.py:765: error: Argument 1 to "sd_single_led_Ohno2005" has incompatible type "floating[_16Bit] | floating[_32Bit] | float64"; expected "float"  [arg-type]
- colour/io/tabular.py:362: error: Value expression in dictionary comprehension has incompatible type "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]"; expected type "floating[_16Bit] | floating[_32Bit] | float64"  [misc]
- colour/corresponding/prediction.py:319: error: Argument 2 to "CorrespondingColourDataset" has incompatible type "floating[Any]"; expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]"  [arg-type]
- colour/corresponding/prediction.py:319: error: Argument 3 to "CorrespondingColourDataset" has incompatible type "floating[Any]"; expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]"  [arg-type]
- colour/notation/munsell.py:1584: error: Incompatible types in assignment (expression has type "int", variable has type "floating[_16Bit] | floating[_32Bit] | float64")  [assignment]
- colour/notation/munsell.py:1584: error: Incompatible types in assignment (expression has type "floating[_16Bit] | floating[_32Bit | _64Bit] | floating[_32Bit]", variable has type "floating[_16Bit] | floating[_32Bit] | float64")  [assignment]
- colour/notation/munsell.py:1587: error: Argument 1 to "tstack" has incompatible type "list[float | floating[_16Bit] | floating[_32Bit]]"; expected "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]"  [arg-type]
- colour/notation/munsell.py:1840: error: Incompatible types in assignment (expression has type "floating[_16Bit] | floating[_32Bit | _64Bit] | floating[_32Bit]", variable has type "float")  [assignment]
- colour/notation/munsell.py:1842: error: Incompatible types in assignment (expression has type "floating[_16Bit] | floating[_32Bit] | float64", variable has type "float")  [assignment]
- colour/notation/munsell.py:1843: error: Incompatible types in assignment (expression has type "floating[_16Bit] | floating[_32Bit] | float64", variable has type "float")  [assignment]
- colour/notation/munsell.py:1854: error: Incompatible types in assignment (expression has type "floating[_16Bit] | floating[_32Bit | _64Bit] | floating[_32Bit]", variable has type "float")  [assignment]
- colour/notation/munsell.py:1858: error: Incompatible types in assignment (expression has type "floating[_16Bit] | floating[_32Bit] | float64", variable has type "float")  [assignment]
- colour/notation/munsell.py:1859: error: Incompatible types in assignment (expression has type "floating[_16Bit] | floating[_32Bit] | float64", variable has type "float")  [assignment]
- colour/notation/munsell.py:1992: error: Incompatible return value type (got "int | floating[_16Bit] | floating[_32Bit] | floating[_32Bit | _64Bit]", expected "float")  [return-value]
- colour/notation/munsell.py:2048: error: Incompatible types in assignment (expression has type "int", variable has type "floating[_16Bit] | floating[_32Bit] | float64")  [assignment]
- colour/notation/munsell.py:2057: error: Unsupported operand types for >= ("float" and "object")  [operator]
- colour/notation/munsell.py:2062: error: Incompatible types in assignment (expression has type "int", variable has type "floating[_16Bit] | floating[_32Bit] | float64")  [assignment]
- colour/notation/munsell.py:2330: error: Incompatible types in assignment (expression has type "int", variable has type "floating[_16Bit] | floating[_32Bit] | float64")  [assignment]
- colour/notation/munsell.py:2339: error: Unsupported operand types for >= ("float" and "object")  [operator]
- colour/notation/munsell.py:2343: error: Incompatible types in assignment (expression has type "int", variable has type "floating[_16Bit] | floating[_32Bit] | float64")  [assignment]
- colour/notation/munsell.py:2348: error: Unsupported operand types for > ("float" and "object")  [operator]
- colour/notation/munsell.py:2349: error: Unsupported operand types for > ("float" and "object")  [operator]
- colour/notation/munsell.py:2350: error: Unsupported operand types for > ("float" and "object")  [operator]
- colour/notation/munsell.py:2351: error: Unsupported operand types for > ("float" and "object")  [operator]
- colour/notation/munsell.py:2352: error: Unsupported operand types for > ("float" and "object")  [operator]
- colour/notation/munsell.py:2354: error: Incompatible types in assignment (expression has type "float", variable has type "floating[_16Bit] | floating[_32Bit] | float64")  [assignment]
- colour/notation/munsell.py:2361: error: "floating[_16Bit]" object is not iterable  [misc]
- colour/notation/munsell.py:2361: error: "floating[_32Bit]" object is not iterable  [misc]
- colour/notation/munsell.py:2361: error: "float64" object is not iterable  [misc]
- colour/notation/munsell.py:2362: error: "floating[_16Bit]" object is not iterable  [misc]
- colour/notation/munsell.py:2362: error: "floating[_32Bit]" object is not iterable  [misc]
- colour/notation/munsell.py:2362: error: "float64" object is not iterable  [misc]
- colour/notation/munsell.py:2410: error: Incompatible types in assignment (expression has type "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]", variable has type "floating[_16Bit] | floating[_32Bit] | float64")  [assignment]
- colour/notation/munsell.py:2411: error: Incompatible types in assignment (expression has type "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]", variable has type "floating[_16Bit] | floating[_32Bit] | float64")  [assignment]
- colour/notation/munsell.py:2536: error: "floating[_16Bit]" object is not iterable  [misc]
- colour/notation/munsell.py:2536: error: "floating[_32Bit]" object is not iterable  [misc]
- colour/notation/munsell.py:2536: error: "float64" object is not iterable  [misc]
- colour/notation/munsell.py:2537: error: "floating[_16Bit]" object is not iterable  [misc]
- colour/notation/munsell.py:2537: error: "floating[_32Bit]" object is not iterable  [misc]
- colour/notation/munsell.py:2537: error: "float64" object is not iterable  [misc]
- colour/notation/munsell.py:2544: error: Argument 1 to "index" of "list" has incompatible type "tuple[Any, floating[_16Bit] | floating[_32Bit] | float64, Any]"; expected "tuple[float, float]"  [arg-type]
+ colour/notation/munsell.py:2544: error: Argument 1 to "index" of "list" has incompatible type "tuple[Any, Any, Any]"; expected "tuple[float, float]"  [arg-type]
- colour/notation/munsell.py:2549: error: Argument 1 to "index" of "list" has incompatible type "tuple[Any, floating[_16Bit] | floating[_32Bit] | float64, Any]"; expected "tuple[float, float]"  [arg-type]
+ colour/notation/munsell.py:2549: error: Argument 1 to "index" of "list" has incompatible type "tuple[Any, Any, Any]"; expected "tuple[float, float]"  [arg-type]
- colour/notation/munsell.py:2556: error: Argument 1 to "index" of "list" has incompatible type "tuple[Any, floating[_16Bit] | floating[_32Bit] | float64, Any]"; expected "tuple[float, float]"  [arg-type]
+ colour/notation/munsell.py:2556: error: Argument 1 to "index" of "list" has incompatible type "tuple[Any, Any, Any]"; expected "tuple[float, float]"  [arg-type]
- colour/notation/munsell.py:2561: error: Argument 1 to "index" of "list" has incompatible type "tuple[Any, floating[_16Bit] | floating[_32Bit] | float64, Any]"; expected "tuple[float, float]"  [arg-type]
+ colour/notation/munsell.py:2561: error: Argument 1 to "index" of "list" has incompatible type "tuple[Any, Any, Any]"; expected "tuple[float, float]"  [arg-type]
- colour/notation/munsell.py:2627: error: Incompatible types in assignment (expression has type "int", variable has type "floating[_16Bit] | floating[_32Bit] | float64")  [assignment]
- colour/notation/munsell.py:2652: error: Incompatible types in assignment (expression has type "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]", variable has type "floating[_16Bit] | floating[_32Bit] | float64")  [assignment]
- colour/notation/munsell.py:2653: error: Incompatible types in assignment (expression has type "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]", variable has type "floating[_16Bit] | floating[_32Bit] | float64")  [assignment]
- colour/quality/cri.py:208: error: Argument 1 to "sd_blackbody" has incompatible type "floating[_16Bit] | floating[_32Bit] | float64"; expected "float"  [arg-type]
- colour/quality/cqs.py:259: error: Argument 1 to "sd_blackbody" has incompatible type "floating[_16Bit] | floating[_32Bit] | float64"; expected "float"  [arg-type]
- colour/plotting/volume.py:261: error: Value of type variable "SupportsRichComparisonT" of "sorted" cannot be "floating[_16Bit] | floating[_32Bit] | float64"  [type-var]
- colour/plotting/volume.py:268: error: Incompatible types in assignment (expression has type "int | floating[_16Bit] | floating[_32Bit] | float64", variable has type "floating[_16Bit] | floating[_32Bit] | float64")  [assignment]
- colour/plotting/models.py:1467: error: Argument 1 to "Ellipse" has incompatible type "tuple[floating[_16Bit] | floating[_32Bit] | float64, floating[_16Bit] | floating[_32Bit] | float64]"; expected "tuple[float, float]"  [arg-type]
- colour/plotting/models.py:1468: error: Argument 2 to "Ellipse" has incompatible type "floating[_16Bit] | floating[_32Bit] | float64"; expected "float"  [arg-type]
- colour/plotting/models.py:1469: error: Argument 3 to "Ellipse" has incompatible type "floating[_16Bit] | floating[_32Bit] | float64"; expected "float"  [arg-type]
- colour/plotting/models.py:1470: error: Argument "angle" to "Ellipse" has incompatible type "floating[_16Bit] | floating[_32Bit] | float64"; expected "float"  [arg-type]
- colour/plotting/colorimetry.py:195: error: No overload variant of "max" matches argument types "floating[_16Bit] | floating[_32Bit] | float64", "floating[_16Bit] | floating[_32Bit] | float64"  [call-overload]
- colour/plotting/colorimetry.py:195: note: Possible overload variants:
- colour/plotting/colorimetry.py:195: note:     def [SupportsRichComparisonT: SupportsDunderLT[Any] | SupportsDunderGT[Any]] max(SupportsRichComparisonT, SupportsRichComparisonT, /, *_args: SupportsRichComparisonT, key: None = ...) -> SupportsRichComparisonT
- colour/plotting/colorimetry.py:195: note:     def [_T] max(_T, _T, /, *_args: _T, key: Callable[[_T], SupportsDunderLT[Any] | SupportsDunderGT[Any]]) -> _T
- colour/plotting/colorimetry.py:195: note:     def [SupportsRichComparisonT: SupportsDunderLT[Any] | SupportsDunderGT[Any]] max(Iterable[SupportsRichComparisonT], /, *, key: None = ...) -> SupportsRichComparisonT
- colour/plotting/colorimetry.py:195: note:     def [_T] max(Iterable[_T], /, *, key: Callable[[_T], SupportsDunderLT[Any] | SupportsDunderGT[Any]]) -> _T
- colour/plotting/colorimetry.py:195: note:     def [SupportsRichComparisonT: SupportsDunderLT[Any] | SupportsDunderGT[Any], _T] max(Iterable[SupportsRichComparisonT], /, *, key: None = ..., default: _T) -> SupportsRichComparisonT | _T
- colour/plotting/colorimetry.py:195: note:     def [_T1, _T2] max(Iterable[_T1], /, *, key: Callable[[_T1], SupportsDunderLT[Any] | SupportsDunderGT[Any]], default: _T2) -> _T1 | _T2
- colour/plotting/colorimetry.py:195: error: Value of type variable "SupportsRichComparisonT" of "min" cannot be "floating[_16Bit] | floating[_32Bit] | float64"  [type-var]
- colour/plotting/colorimetry.py:196: error: No overload variant of "min" matches argument types "floating[_16Bit] | floating[_32Bit] | float64", "floating[_16Bit] | floating[_32Bit] | float64"  [call-overload]
- colour/plotting/colorimetry.py:196: note: Possible overload variants:
- colour/plotting/colorimetry.py:196: note:     def [SupportsRichComparisonT: SupportsDunderLT[Any] | SupportsDunderGT[Any]] min(SupportsRichComparisonT, SupportsRichComparisonT, /, *_args: SupportsRichComparisonT, key: None = ...) -> SupportsRichComparisonT
- colour/plotting/colorimetry.py:196: note:     def [_T] min(_T, _T, /, *_args: _T, key: Callable[[_T], SupportsDunderLT[Any] | SupportsDunderGT[Any]]) -> _T
- colour/plotting/colorimetry.py:196: note:     def [SupportsRichComparisonT: SupportsDunderLT[Any] | SupportsDunderGT[Any]] min(Iterable[SupportsRichComparisonT], /, *, key: None = ...) -> SupportsRichComparisonT
- colour/plotting/colorimetry.py:196: note:     def [_T] min(Iterable[_T], /, *, key: Callable[[_T], SupportsDunderLT[Any] | SupportsDunderGT[Any]]) -> _T
- colour/plotting/colorimetry.py:196: note:     def [SupportsRichComparisonT: SupportsDunderLT[Any] | SupportsDunderGT[Any], _T] min(Iterable[SupportsRichComparisonT], /, *, key: None = ..., default: _T) -> SupportsRichComparisonT | _T
- colour/plotting/colorimetry.py:196: note:     def [_T1, _T2] min(Iterable[_T1], /, *, key: Callable[[_T1], SupportsDunderLT[Any] | SupportsDunderGT[Any]], default: _T2) -> _T1 | _T2
- colour/plotting/colorimetry.py:196: error: Value of type variable "SupportsRichComparisonT" of "max" cannot be "floating[_16Bit] | floating[_32Bit] | float64"  [type-var]
- colour/plotting/colorimetry.py:223: error: Value of type variable "SupportsRichComparisonT" of "min" cannot be "floating[_16Bit] | floating[_32Bit] | float64"  [type-var]

... (truncated 48 lines) ...

@charris charris merged commit f6a17f0 into numpy:main Jun 17, 2025
76 of 77 checks passed
@charris
Copy link
Member

charris commented Jun 17, 2025

Thanks Joren.

@jorenham jorenham deleted the typing/fix-29214 branch June 17, 2025 18:16
charris pushed a commit to charris/numpy that referenced this pull request Jun 17, 2025
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Jun 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TYP: incorrect type inference for iteration elements? (numpy 2.3.0)
2 participants