Repository navigation
Make joins with Any more precise - #22336
ilevkivskyi wants to merge 6 commits into
Conversation
|
Primer will be interesting! :-) |
This comment has been minimized.
This comment has been minimized.
|
I had a feeling that dict would be painful |
|
Yes, this is essentially #5382. I will take a look at actual code examples, we may fix most cases with something similar to |
|
Or alternatively we can special-case |
|
I would be okay with a dict special case |
|
The dict special case is reasonable, since heterogeneous dicts are very common. |
|
OK, so I have spent some time playing with this. Couple things to note: There are three different ways to special-case a: Any
counts: dict[str, int] = {"hits": a, "misses": "42"}Fixing #5382 by making def foo(a: int, b: str) -> None: ...
def shuffle(d: dict[str, object]) -> None: ...
d = {"a": 42, "b": "yes"}
shuffle(d)
foo(**d)(without also creating a bunch of false positives, in particular for something like @JukkaL @hauntsaninja Do you still prefer special-casing dicts? If yes, then which one of the three I mentioned? |
|
We discussed with @JukkaL that it is best to try special-casing |
|
Diff from mypy_primer, showing the effect of this PR on open source code: optuna (https://github.com/optuna/optuna)
+ optuna/cli.py:731: error: Argument "study_name" to "load_study" has incompatible type "bool | BaseStorage | Any"; expected "str | None" [arg-type]
+ optuna/cli.py:732: error: Argument "storage" to "load_study" has incompatible type "bool | BaseStorage | Any"; expected "str | BaseStorage" [arg-type]
+ optuna/cli.py:733: error: Argument "sampler" to "load_study" has incompatible type "bool | BaseStorage | Any | None"; expected "BaseSampler | None" [arg-type]
spark (https://github.com/apache/spark)
+ python/pyspark/core/rdd.py:1384: error: Value of type variable "SupportsRichComparisonT" of "bisect_left" cannot be "K | Any" [type-var]
+ python/pyspark/pandas/frame.py:10263: error: Argument 1 to "summary" of "DataFrame" has incompatible type "*list[list[str] | Any]"; expected "str" [arg-type]
+ python/pyspark/pandas/numpy_compat.py:597: error: Argument 1 to "column_op" has incompatible type "Callable[[Column], Column] | overloaded function | Callable[[Any], Any] | Callable[[Column | str], Column] | Callable[[Any], object] | Any"; expected "Callable[..., Column]" [arg-type]
+ python/pyspark/sql/connect/session.py:754: error: Item "Hashable" of "Hashable | Any | Any" has no attribute "items" [union-attr]
+ python/pyspark/mllib/clustering.py:943: error: Incompatible return value type (got "list[float | Any | Any]", expected "list[float64]") [return-value]
prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/deployments/runner.py:1005: error: Argument 1 to "construct_schedule" has incompatible type "**dict[str, str | Any | int | float | timedelta | datetime | None]"; expected "int | float | timedelta | None" [arg-type]
- src/prefect/deployments/runner.py:1005: error: Argument 1 to "construct_schedule" has incompatible type "**dict[str, str | Any | int | float | timedelta | datetime | None]"; expected "datetime | str | None" [arg-type]
- src/prefect/deployments/runner.py:1005: error: Argument 1 to "construct_schedule" has incompatible type "**dict[str, str | Any | int | float | timedelta | datetime | None]"; expected "str | None" [arg-type]
+ src/prefect/server/models/block_schemas.py:587: error: Need type annotation for "block_schema_fields_copy" [var-annotated]
+ src/prefect/server/services/cancellation_cleanup.py:357: error: Argument 1 to "enqueue" of "WorkerCleanupQueue" has incompatible type "**dict[str, object]"; expected "UUID" [arg-type]
+ src/prefect/server/services/cancellation_cleanup.py:357: error: Argument 1 to "enqueue" of "WorkerCleanupQueue" has incompatible type "**dict[str, object]"; expected "str" [arg-type]
+ src/prefect/server/services/cancellation_cleanup.py:357: error: Argument 1 to "enqueue" of "WorkerCleanupQueue" has incompatible type "**dict[str, object]"; expected "Literal['cancelling_timeout_teardown.v1', 'pending_claim_teardown.v1']" [arg-type]
+ src/prefect/server/services/cancellation_cleanup.py:357: error: Argument 1 to "enqueue" of "WorkerCleanupQueue" has incompatible type "**dict[str, object]"; expected "Mapping[str, Any]" [arg-type]
+ src/prefect/server/services/cancellation_cleanup.py:357: error: Argument 1 to "enqueue" of "WorkerCleanupQueue" has incompatible type "**dict[str, object]"; expected "Mapping[str, Any] | None" [arg-type]
+ src/prefect/server/services/cancellation_cleanup.py:357: error: Argument 1 to "enqueue" of "WorkerCleanupQueue" has incompatible type "**dict[str, object]"; expected "UUID | None" [arg-type]
- src/prefect/cli/deploy/_schedules.py:70: error: Argument 1 to "IntervalSchedule" has incompatible type "**dict[str, timedelta | Any | datetime]"; expected "timedelta" [arg-type]
- src/prefect/cli/deploy/_schedules.py:70: error: Argument 1 to "IntervalSchedule" has incompatible type "**dict[str, timedelta | Any | datetime]"; expected "DateTime | datetime | str | None" [arg-type]
- src/prefect/cli/deploy/_schedules.py:70: error: Argument 1 to "IntervalSchedule" has incompatible type "**dict[str, timedelta | Any | datetime]"; expected "str | None" [arg-type]
openlibrary (https://github.com/internetarchive/openlibrary)
+ openlibrary/catalog/add_book/__init__.py: note: In function "new_work":
+ openlibrary/catalog/add_book/__init__.py:308: error: Item "dict[str, str]" of "dict[str, str] | Any" has no attribute "append" [union-attr]
+ openlibrary/catalog/add_book/__init__.py: note: At top level:
- openlibrary/tests/core/test_layout.py: note: In function "_req":
- openlibrary/tests/core/test_layout.py:27: error: Argument 1 to "ShellRequest" has incompatible type "**dict[str, str | Any]"; expected "bool" [arg-type]
- openlibrary/tests/core/test_layout.py:27: error: Argument 1 to "ShellRequest" has incompatible type "**dict[str, str | Any]"; expected "tuple[dict[str, str], ...]" [arg-type]
- openlibrary/tests/core/test_layout.py:27: error: Argument 1 to "ShellRequest" has incompatible type "**dict[str, str | Any]"; expected "dict[str, Any]" [arg-type]
- openlibrary/tests/core/test_layout.py:27: note: "dict" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
- openlibrary/tests/core/test_layout.py:27: note: Consider using "Mapping" instead, which is covariant in the value type
- openlibrary/tests/core/test_layout.py:27: error: Argument 1 to "ShellRequest" has incompatible type "**dict[str, str | Any]"; expected "list[Any]" [arg-type]
- openlibrary/tests/core/test_layout.py:27: error: Argument 1 to "ShellRequest" has incompatible type "**dict[str, str | Any]"; expected "float" [arg-type]
- openlibrary/tests/core/test_layout.py: note: In function "_user":
- openlibrary/tests/core/test_layout.py:32: error: Argument 1 to "ShellUser" has incompatible type "**dict[str, int | bool | str | Any | None]"; expected "str" [arg-type]
- openlibrary/tests/core/test_layout.py:32: error: Argument 1 to "ShellUser" has incompatible type "**dict[str, int | bool | str | Any | None]"; expected "datetime | None" [arg-type]
- openlibrary/tests/core/test_layout.py:32: error: Argument 1 to "ShellUser" has incompatible type "**dict[str, int | bool | str | Any | None]"; expected "str | None" [arg-type]
- openlibrary/tests/core/test_layout.py:32: error: Argument 1 to "ShellUser" has incompatible type "**dict[str, int | bool | str | Any | None]"; expected "bool" [arg-type]
- openlibrary/tests/core/test_layout.py:32: error: Argument 1 to "ShellUser" has incompatible type "**dict[str, int | bool | str | Any | None]"; expected "int" [arg-type]
- openlibrary/tests/core/test_layout.py: note: At top level:
+ openlibrary/plugins/books/dynlinks.py: note: In member "process_doc" of class "DataProcessor":
+ openlibrary/plugins/books/dynlinks.py:352: error: "object" has no attribute "insert" [attr-defined]
+ openlibrary/plugins/books/dynlinks.py:391: error: Argument 1 to "trim" has incompatible type "object"; expected "dict[Any, Any]" [arg-type]
+ openlibrary/plugins/books/dynlinks.py:392: error: Argument 1 to "trim" has incompatible type "object"; expected "dict[Any, Any]" [arg-type]
colour (https://github.com/colour-science/colour)
- colour/io/luts/lut.py:1433: error: No overload variant of "pad" matches argument types "ndarray[tuple[Any, ...], dtype[float64 | 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[tuple[Any, ...], dtype[float64 | Any]]", "tuple[int, signedinteger[_8Bit] | signedinteger[_16Bit] | signedinteger[_32Bit] | signedinteger[_64Bit] | unsignedinteger[_8Bit] | unsignedinteger[_16Bit] | unsignedinteger[_32Bit] | unsignedinteger[_64Bit] | Any]", "str", "float" [call-overload]
+ colour/notation/munsell/centore2014.py:849: error: Argument 1 to "xp_as_float_array" has incompatible type "list[ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]] | Any | float]"; expected "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str]" [arg-type]
+ colour/plotting/common.py:1738: error: Argument 2 to "imshow" of "Axes" has incompatible type "**dict[str, object]"; expected "str | Colormap | None" [arg-type]
+ colour/plotting/common.py:1738: error: Argument 2 to "imshow" of "Axes" has incompatible type "**dict[str, object]"; expected "str | Normalize | None" [arg-type]
+ colour/plotting/common.py:1738: error: Argument 2 to "imshow" of "Axes" has incompatible type "**dict[str, object]"; expected "Literal['equal', 'auto'] | float | None" [arg-type]
+ colour/plotting/common.py:1738: error: Argument 2 to "imshow" of "Axes" has incompatible type "**dict[str, object]"; expected "str | None" [arg-type]
+ colour/plotting/common.py:1738: error: Argument 2 to "imshow" of "Axes" has incompatible type "**dict[str, object]"; expected "float | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | None" [arg-type]
+ colour/plotting/common.py:1738: error: Argument 2 to "imshow" of "Axes" has incompatible type "**dict[str, object]"; expected "float | None" [arg-type]
+ colour/plotting/common.py:1738: error: Argument 2 to "imshow" of "Axes" has incompatible type "**dict[str, object]"; expected "Colorizer | None" [arg-type]
+ colour/plotting/common.py:1738: error: Argument 2 to "imshow" of "Axes" has incompatible type "**dict[str, object]"; expected "Literal['upper', 'lower'] | None" [arg-type]
+ colour/plotting/common.py:1738: error: Argument 2 to "imshow" of "Axes" has incompatible type "**dict[str, object]"; expected "tuple[float, float, float, float] | None" [arg-type]
+ colour/plotting/common.py:1738: error: Argument 2 to "imshow" of "Axes" has incompatible type "**dict[str, object]"; expected "Literal['data', 'rgba', 'auto'] | None" [arg-type]
+ colour/plotting/common.py:1738: error: Argument 2 to "imshow" of "Axes" has incompatible type "**dict[str, object]"; expected "bool" [arg-type]
+ colour/plotting/common.py:1738: error: Argument 2 to "imshow" of "Axes" has incompatible type "**dict[str, object]"; expected "float" [arg-type]
+ colour/plotting/common.py:1738: error: Argument 2 to "imshow" of "Axes" has incompatible type "**dict[str, object]"; expected "bool | None" [arg-type]
+ colour/plotting/common.py:1738: error: Argument 2 to "imshow" of "Axes" has incompatible type "**dict[str, object]"; expected "Mapping[str, Any] | None" [arg-type]
+ colour/plotting/common.py:1744: error: Argument 1 to "text" of "Axes" has incompatible type "float | Any | None"; expected "float" [arg-type]
+ colour/plotting/common.py:1745: error: Argument 2 to "text" of "Axes" has incompatible type "float | Any | None"; expected "float" [arg-type]
+ colour/plotting/common.py:1746: error: Argument 3 to "text" of "Axes" has incompatible type "float | Any | None"; expected "str" [arg-type]
+ colour/plotting/temperature.py:701: error: Argument 3 to "annotate" of "Axes" has incompatible type "**dict[str, object]"; expected "tuple[Any, Any] | None" [arg-type]
+ colour/plotting/temperature.py:701: error: Argument 3 to "annotate" of "Axes" has incompatible type "**dict[str, object]"; expected "str | Artist | Transform | Callable[[RendererBase], Bbox | Transform] | tuple[str | Artist | Transform | Callable[[RendererBase], Bbox | Transform], str | Artist | Transform | Callable[[RendererBase], Bbox | Transform]]" [arg-type]
+ colour/plotting/temperature.py:701: error: Argument 3 to "annotate" of "Axes" has incompatible type "**dict[str, object]"; expected "str | Artist | Transform | Callable[[RendererBase], Bbox | Transform] | tuple[str | Artist | Transform | Callable[[RendererBase], Bbox | Transform], str | Artist | Transform | Callable[[RendererBase], Bbox | Transform]] | None" [arg-type]
+ colour/plotting/temperature.py:701: error: Argument 3 to "annotate" of "Axes" has incompatible type "**dict[str, object]"; expected "dict[str, Any] | None" [arg-type]
+ colour/plotting/temperature.py:701: note: "dict" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
+ colour/plotting/temperature.py:701: note: Consider using "Mapping" instead, which is covariant in the value type
+ colour/plotting/temperature.py:701: error: Argument 3 to "annotate" of "Axes" has incompatible type "**dict[str, object]"; expected "bool | None" [arg-type]
- colour/plotting/phenomena.py:562: error: Incompatible types in assignment (expression has type "ndarray[tuple[Any, ...], dtype[Any]]", variable has type "list[Any]") [assignment]
+ colour/plotting/phenomena.py:562: error: Incompatible types in assignment (expression has type "ndarray[tuple[Any, ...], dtype[Any]]", variable has type "list[float | Any | Any]") [assignment]
+ colour/plotting/models.py:1066: error: Argument "apply_cctf_encoding" to "RGB_to_RGB" has incompatible type "object"; expected "bool" [arg-type]
+ colour/plotting/models.py:1080: error: Argument 3 to "scatter" of "Axes" has incompatible type "**dict[str, object]"; expected "float | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | None" [arg-type]
+ colour/plotting/models.py:1080: error: Argument 3 to "scatter" of "Axes" has incompatible type "**dict[str, object]"; expected "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Sequence[tuple[float, float, float] | str | str | tuple[float, float, float, float] | tuple[tuple[float, float, float] | str, float] | tuple[tuple[float, float, float, float], float]] | tuple[float, float, float] | str | str | tuple[float, float, float, float] | tuple[tuple[float, float, float] | str, float] | tuple[tuple[float, float, float, float], float] | None" [arg-type]
+ colour/plotting/models.py:1080: error: Argument 3 to "scatter" of "Axes" has incompatible type "**dict[str, object]"; expected "Literal['.', ',', 'o', 'v', '^', '<', '>', '1', '2', '3', '4', '8', 's', 'p', 'P', '*', 'h', 'H', '+', 'x', 'X', 'D', 'd', '|', '_', 'none', ' ', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] | Path | MarkerStyle | str | list[tuple[int, int]] | tuple[int, Literal[0, 1, 2], int] | None" [arg-type]
+ colour/plotting/models.py:1080: error: Argument 3 to "scatter" of "Axes" has incompatible type "**dict[str, object]"; expected "str | Colormap | None" [arg-type]
+ colour/plotting/models.py:1080: error: Argument 3 to "scatter" of "Axes" has incompatible type "**dict[str, object]"; expected "str | Normalize | None" [arg-type]
+ colour/plotting/models.py:1080: error: Argument 3 to "scatter" of "Axes" has incompatible type "**dict[str, object]"; expected "float | None" [arg-type]
+ colour/plotting/models.py:1080: error: Argument 3 to "scatter" of "Axes" has incompatible type "**dict[str, object]"; expected "float | Sequence[float] | None" [arg-type]
+ colour/plotting/models.py:1080: error: Argument 3 to "scatter" of "Axes" has incompatible type "**dict[str, object]"; expected "Literal['face', 'none'] | tuple[float, float, float] | str | str | tuple[float, float, float, float] | tuple[tuple[float, float, float] | str, float] | tuple[tuple[float, float, float, float], float] | Sequence[tuple[float, float, float] | str | str | tuple[float, float, float, float] | tuple[tuple[float, float, float] | str, float] | tuple[tuple[float, float, float, float], float]] | None" [arg-type]
+ colour/plotting/models.py:1080: error: Argument 3 to "scatter" of "Axes" has incompatible type "**dict[str, object]"; expected "Colorizer | None" [arg-type]
+ colour/plotting/models.py:1080: error: Argument 3 to "scatter" of "Axes" has incompatible type "**dict[str, object]"; expected "bool" [arg-type]
+ colour/plotting/models.py:1080: error: Argument 3 to "scatter" of "Axes" has incompatible type "**dict[str, object]"; expected "Mapping[str, Any] | None" [arg-type]
+ colour/plotting/models.py:2019: error: Incompatible types in assignment (expression has type "object", variable has type "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]") [assignment]
+ colour/plotting/models.py:2021: error: Argument 3 to "scatter" of "Axes" has incompatible type "**dict[str, object]"; expected "float | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | None" [arg-type]
+ colour/plotting/models.py:2021: error: Argument 3 to "scatter" of "Axes" has incompatible type "**dict[str, object]"; expected "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | Sequence[tuple[float, float, float] | str | str | tuple[float, float, float, float] | tuple[tuple[float, float, float] | str, float] | tuple[tuple[float, float, float, float], float]] | tuple[float, float, float] | str | str | tuple[float, float, float, float] | tuple[tuple[float, float, float] | str, float] | tuple[tuple[float, float, float, float], float] | None" [arg-type]
+ colour/plotting/models.py:2021: error: Argument 3 to "scatter" of "Axes" has incompatible type "**dict[str, object]"; expected "Literal['.', ',', 'o', 'v', '^', '<', '>', '1', '2', '3', '4', '8', 's', 'p', 'P', '*', 'h', 'H', '+', 'x', 'X', 'D', 'd', '|', '_', 'none', ' ', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] | Path | MarkerStyle | str | list[tuple[int, int]] | tuple[int, Literal[0, 1, 2], int] | None" [arg-type]
+ colour/plotting/models.py:2021: error: Argument 3 to "scatter" of "Axes" has incompatible type "**dict[str, object]"; expected "str | Colormap | None" [arg-type]
+ colour/plotting/models.py:2021: error: Argument 3 to "scatter" of "Axes" has incompatible type "**dict[str, object]"; expected "str | Normalize | None" [arg-type]
+ colour/plotting/models.py:2021: error: Argument 3 to "scatter" of "Axes" has incompatible type "**dict[str, object]"; expected "float | None" [arg-type]
+ colour/plotting/models.py:2021: error: Argument 3 to "scatter" of "Axes" has incompatible type "**dict[str, object]"; expected "float | Sequence[float] | None" [arg-type]
+ colour/plotting/models.py:2021: error: Argument 3 to "scatter" of "Axes" has incompatible type "**dict[str, object]"; expected "Literal['face', 'none'] | tuple[float, float, float] | str | str | tuple[float, float, float, float] | tuple[tuple[float, float, float] | str, float] | tuple[tuple[float, float, float, float], float] | Sequence[tuple[float, float, float] | str | str | tuple[float, float, float, float] | tuple[tuple[float, float, float] | str, float] | tuple[tuple[float, float, float, float], float]] | None" [arg-type]
+ colour/plotting/models.py:2021: error: Argument 3 to "scatter" of "Axes" has incompatible type "**dict[str, object]"; expected "Colorizer | None" [arg-type]
+ colour/plotting/models.py:2021: error: Argument 3 to "scatter" of "Axes" has incompatible type "**dict[str, object]"; expected "bool" [arg-type]
+ colour/plotting/models.py:2021: error: Argument 3 to "scatter" of "Axes" has incompatible type "**dict[str, object]"; expected "Mapping[str, Any] | None" [arg-type]
+ colour/plotting/diagrams.py:1092: error: Argument 1 to "filter_cmfs" has incompatible type "bool | MultiSpectralDistributions | Sequence[MultiSpectralDistributions | str] | Any"; expected "MultiSpectralDistributions | str | Sequence[MultiSpectralDistributions | str]" [arg-type]
+ colour/plotting/diagrams.py:1096: error: Argument 1 to "filter_illuminants" has incompatible type "bool | MultiSpectralDistributions | Sequence[MultiSpectralDistributions | str] | Any"; expected "SpectralDistribution | str | Sequence[SpectralDistribution | str]" [arg-type]
+ colour/plotting/diagrams.py:1118: error: Argument 3 to "annotate" of "Axes" has incompatible type "**dict[str, object]"; expected "tuple[Any, Any] | None" [arg-type]
+ colour/plotting/diagrams.py:1118: error: Argument 3 to "annotate" of "Axes" has incompatible type "**dict[str, object]"; expected "str | Artist | Transform | Callable[[RendererBase], Bbox | Transform] | tuple[str | Artist | Transform | Callable[[RendererBase], Bbox | Transform], str | Artist | Transform | Callable[[RendererBase], Bbox | Transform]]" [arg-type]
+ colour/plotting/diagrams.py:1118: error: Argument 3 to "annotate" of "Axes" has incompatible type "**dict[str, object]"; expected "str | Artist | Transform | Callable[[RendererBase], Bbox | Transform] | tuple[str | Artist | Transform | Callable[[RendererBase], Bbox | Transform], str | Artist | Transform | Callable[[RendererBase], Bbox | Transform]] | None" [arg-type]
+ colour/plotting/diagrams.py:1118: error: Argument 3 to "annotate" of "Axes" has incompatible type "**dict[str, object]"; expected "dict[str, Any] | None" [arg-type]
+ colour/plotting/diagrams.py:1118: note: "dict" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
+ colour/plotting/diagrams.py:1118: note: Consider using "Mapping" instead, which is covariant in the value type
+ colour/plotting/diagrams.py:1118: error: Argument 3 to "annotate" of "Axes" has incompatible type "**dict[str, object]"; expected "bool | None" [arg-type]
+ colour/plotting/colorimetry.py:394: error: Argument 1 to "filter_cmfs" has incompatible type "bool | str | Any"; expected "MultiSpectralDistributions | str | Sequence[MultiSpectralDistributions | str]" [arg-type]
+ colour/plotting/colorimetry.py:398: error: Argument 1 to "filter_illuminants" has incompatible type "bool | str | Any"; expected "SpectralDistribution | str | Sequence[SpectralDistribution | str]" [arg-type]
zope.interface (https://github.com/zopefoundation/zope.interface)
+ src/zope/interface/common/tests/test_collections.py:106: error: Need type annotation for "CONSTRUCTORS" [var-annotated]
isort (https://github.com/pycqa/isort)
+ isort/settings.py:394: error: No overload variant of "frozenset" matches argument type "object" [call-overload]
+ isort/settings.py:394: note: Possible overload variants:
+ isort/settings.py:394: note: def [_T_co] frozenset() -> frozenset[_T_co]
+ isort/settings.py:394: note: def [_T_co] frozenset(Iterable[_T_co], /) -> frozenset[_T_co]
+ isort/settings.py:396: error: No overload variant of "frozenset" matches argument type "object" [call-overload]
+ isort/settings.py:396: note: Possible overload variants:
+ isort/settings.py:396: note: def [_T_co] frozenset() -> frozenset[_T_co]
+ isort/settings.py:396: note: def [_T_co] frozenset(Iterable[_T_co], /) -> frozenset[_T_co]
+ isort/settings.py:397: error: Unsupported right operand type for in ("object") [operator]
+ isort/settings.py:422: error: No overload variant of "frozenset" matches argument type "object" [call-overload]
+ isort/settings.py:422: note: Possible overload variants:
+ isort/settings.py:422: note: def [_T_co] frozenset() -> frozenset[Any]
+ isort/settings.py:422: note: def [_T_co] frozenset(Iterable[Any], /) -> frozenset[Any]
+ isort/settings.py:422: error: Argument 1 to "tuple" has incompatible type "object"; expected "Iterable[Any]" [arg-type]
+ isort/settings.py:424: error: "object" has no attribute "__iter__"; maybe "__dir__" or "__str__"? (not iterable) [attr-defined]
+ isort/settings.py:444: error: Argument 1 to "Path" has incompatible type "object"; expected "str | PathLike[str]" [arg-type]
+ isort/settings.py:450: error: "object" has no attribute "__iter__"; maybe "__dir__" or "__str__"? (not iterable) [attr-defined]
+ isort/settings.py:466: error: Argument 1 to "FormattingPluginDoesNotExist" has incompatible type "object"; expected "str" [arg-type]
+ isort/settings.py:498: error: Argument 2 to "__init__" of "_Config" has incompatible type "**dict[str, object]"; expected "str" [arg-type]
+ isort/settings.py:498: error: Argument 2 to "__init__" of "_Config" has incompatible type "**dict[str, object]"; expected "frozenset[str]" [arg-type]
+ isort/settings.py:498: error: Argument 2 to "__init__" of "_Config" has incompatible type "**dict[str, object]"; expected "bool" [arg-type]
+ isort/settings.py:498: error: Argument 2 to "__init__" of "_Config" has incompatible type "**dict[str, object]"; expected "int" [arg-type]
+ isort/settings.py:498: error: Argument 2 to "__init__" of "_Config" has incompatible type "**dict[str, object]"; expected "tuple[str, ...]" [arg-type]
+ isort/settings.py:498: error: Argument 2 to "__init__" of "_Config" has incompatible type "**dict[str, object]"; expected "dict[str, frozenset[str]]" [arg-type]
+ isort/settings.py:498: error: Argument 2 to "__init__" of "_Config" has incompatible type "**dict[str, object]"; expected "WrapModes" [arg-type]
+ isort/settings.py:498: error: Argument 2 to "__init__" of "_Config" has incompatible type "**dict[str, object]"; expected "dict[str, str]" [arg-type]
+ isort/settings.py:498: error: Argument 2 to "__init__" of "_Config" has incompatible type "**dict[str, object]"; expected "tuple[Path, ...]" [arg-type]
+ isort/settings.py:498: error: Argument 2 to "__init__" of "_Config" has incompatible type "**dict[str, object]"; expected "Callable[[str, str, object], str] | None" [arg-type]
+ isort/settings.py:498: error: Argument 2 to "__init__" of "_Config" has incompatible type "**dict[str, object]"; expected "dict[Path, set[Path]]" [arg-type]
zulip (https://github.com/zulip/zulip)
+ zerver/data_import/slack.py:1566: error: Unsupported target for indexed assignment ("dict[str, Any] | bool | Any") [index]
+ zerver/views/video_calls.py:512: error: Argument "headers" to "post" of "Session" has incompatible type "dict[str, str | None]"; expected "Mapping[str, str | bytes] | None" [arg-type]
+ zerver/tests/test_push_notifications.py:590: error: Need type annotation for "payload" [var-annotated]
+ zerver/data_import/rocketchat.py:562: error: Argument "size" to "UploadRecordData" has incompatible type "float | Any"; expected "int" [arg-type]
+ zerver/data_import/mattermost.py:487: error: Argument "size" to "UploadRecordData" has incompatible type "float | int | Any"; expected "int" [arg-type]
core (https://github.com/home-assistant/core)
+ homeassistant/components/gtfs/sensor.py:426: error: Unsupported operand types for > ("bool" and "str") [operator]
+ homeassistant/components/gtfs/sensor.py:426: error: Unsupported operand types for > ("bool" and "None") [operator]
+ homeassistant/components/gtfs/sensor.py:426: error: Unsupported operand types for > ("str" and "bool") [operator]
+ homeassistant/components/gtfs/sensor.py:426: error: Unsupported operand types for > ("str" and "None") [operator]
+ homeassistant/components/gtfs/sensor.py:426: error: Unsupported operand types for < ("bool" and "None") [operator]
+ homeassistant/components/gtfs/sensor.py:426: error: Unsupported operand types for < ("str" and "None") [operator]
+ homeassistant/components/gtfs/sensor.py:426: error: Unsupported left operand type for > ("None") [operator]
+ homeassistant/components/gtfs/sensor.py:426: note: Both left and right operands are unions
+ homeassistant/components/gtfs/sensor.py:438: error: Unsupported operand types for < ("bool" and "str") [operator]
+ homeassistant/components/gtfs/sensor.py:438: error: Unsupported operand types for < ("bool" and "None") [operator]
+ homeassistant/components/gtfs/sensor.py:438: error: Unsupported operand types for < ("str" and "bool") [operator]
+ homeassistant/components/gtfs/sensor.py:438: error: Unsupported operand types for < ("str" and "None") [operator]
+ homeassistant/components/gtfs/sensor.py:438: error: Unsupported operand types for > ("bool" and "None") [operator]
+ homeassistant/components/gtfs/sensor.py:438: error: Unsupported operand types for > ("str" and "None") [operator]
+ homeassistant/components/gtfs/sensor.py:438: error: Unsupported left operand type for < ("None") [operator]
+ homeassistant/components/gtfs/sensor.py:438: note: Both left and right operands are unions
+ homeassistant/components/gtfs/sensor.py:445: error: Unsupported operand types for < ("bool" and "str") [operator]
+ homeassistant/components/gtfs/sensor.py:445: error: Unsupported operand types for < ("bool" and "None") [operator]
+ homeassistant/components/gtfs/sensor.py:445: error: Unsupported operand types for < ("str" and "bool") [operator]
+ homeassistant/components/gtfs/sensor.py:445: error: Unsupported operand types for < ("str" and "None") [operator]
+ homeassistant/components/gtfs/sensor.py:445: error: Unsupported operand types for > ("bool" and "None") [operator]
+ homeassistant/components/gtfs/sensor.py:445: error: Unsupported operand types for > ("str" and "None") [operator]
+ homeassistant/components/gtfs/sensor.py:445: error: Unsupported left operand type for < ("None") [operator]
+ homeassistant/components/gtfs/sensor.py:445: note: Both left and right operands are unions
+ homeassistant/components/counter/entity.py:96: error: Value of type variable "SupportsRichComparisonT" of "max" cannot be "int | Any | None" [type-var]
+ homeassistant/components/counter/entity.py:98: error: Value of type variable "SupportsRichComparisonT" of "min" cannot be "int | Any | None" [type-var]
+ homeassistant/components/nederlandse_spoorwegen/diagnostics.py:93: error: Incompatible types in assignment (expression has type "dict[str, int]", target has type "dict[str, str | None] | dict[str, str | Any | Any | Any | None] | None") [assignment]
+ homeassistant/components/icloud/account.py:1111: error: Incompatible return value type (got "float | Any | None", expected "str | None") [return-value]
+ homeassistant/components/satel_integra/config_flow.py:235: error: Argument 1 to "test_connection" of "SatelConfigFlow" has incompatible type "Any | None"; expected "str" [arg-type]
+ homeassistant/components/satel_integra/config_flow.py:236: error: Argument 2 to "test_connection" of "SatelConfigFlow" has incompatible type "Any | None"; expected "int" [arg-type]
+ homeassistant/components/satel_integra/config_flow.py:248: error: Argument "title" to "async_update_reload_and_abort" of "ConfigFlow" has incompatible type "Any | None"; expected "str | Undefined" [arg-type]
+ homeassistant/components/seventeentrack/coordinator.py:75: error: Need type annotation for "summary_dict" (hint: "summary_dict: dict[<type>, <type>] = ...") [var-annotated]
+ homeassistant/components/forked_daapd/config_flow.py:197: error: Incompatible types (expression has type "dict[str, str | int | Any | None]", TypedDict item "title_placeholders" has type "Mapping[str, str]") [typeddict-item]
+ homeassistant/components/generic/config_flow.py:461: error: Unsupported target for indexed assignment ("str | Any | Any | None") [index]
+ homeassistant/components/solaredge_modbus/config_flow.py:97: error: Invalid index type "str" for "str"; expected type "SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" [index]
+ homeassistant/components/modbus/cover.py:100: error: Argument 1 to "_set_attr_state" of "ModbusCover" has incompatible type "Any | Any | Any | Any | None"; expected "str | bool | int" [arg-type]
- homeassistant/components/flux_led/number.py:183: error: Returning Any from function declared to return "int" [no-any-return]
- homeassistant/components/flux_led/number.py:213: error: Returning Any from function declared to return "int" [no-any-return]
- homeassistant/components/flux_led/number.py:251: error: Returning Any from function declared to return "int" [no-any-return]
- homeassistant/components/flux_led/number.py:282: error: Returning Any from function declared to return "int" [no-any-return]
+ homeassistant/components/risco/config_flow.py:271: error: Value of type "object" is not indexable [index]
+ homeassistant/components/risco/config_flow.py:292: error: "object" has no attribute "values" [attr-defined]
+ homeassistant/components/risco/config_flow.py:298: error: Value of type "object" is not indexable [index]
+ homeassistant/components/risco/config_flow.py:300: error: "object" has no attribute "get" [attr-defined]
+ homeassistant/components/p1_monitor/diagnostics.py:41: error: Unsupported target for indexed assignment ("object") [index]
+ homeassistant/components/neopool/config_flow.py:99: error: Invalid index type "str" for "str"; expected type "SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]" [index]
+ homeassistant/components/rainforest_raven/diagnostics.py:22: error: Need type annotation for "redacted" [var-annotated]
+ homeassistant/components/open_router/entity.py:379: error: Invalid index type "int" for "dict[str, Any]"; expected type "str" [index]
+ homeassistant/components/open_router/entity.py:379: error: Invalid index type "int" for "dict[str, str]"; expected type "str" [index]
+ homeassistant/components/open_router/entity.py:417: error: Item "dict[str, Any]" of "dict[str, Any] | dict[str, str] | str | Any" has no attribute "extend" [union-attr]
+ homeassistant/components/open_router/entity.py:417: error: Item "dict[str, str]" of "dict[str, Any] | dict[str, str] | str | Any" has no attribute "extend" [union-attr]
+ homeassistant/components/open_router/entity.py:417: error: Item "str" of "dict[str, Any] | dict[str, str] | str | Any" has no attribute "extend" [union-attr]
+ homeassistant/components/amberelectric/sensor.py:134: error: Need type annotation for "data" [var-annotated]
+ homeassistant/components/litellm/entity.py:203: error: Item "str" of "str | Any" has no attribute "extend" [union-attr]
+ homeassistant/components/scrape/__init__.py:160: error: Need type annotation for "subentry_config" [var-annotated]
+ homeassistant/components/homematicip_cloud/config_flow.py:117: error: Argument 2 to "HomematicipAuth" has incompatible type "dict[str, Any | Any | None]"; expected "dict[str, str]" [arg-type]
- homeassistant/components/lyngdorf/media_player.py:110: error: Returning Any from function declared to return "float" [no-any-return]
+ homeassistant/components/goodwe/number.py:177: error: Value of type variable "SupportsRichComparisonT" of "max" cannot be "float | Any | None" [type-var]
+ homeassistant/components/goodwe/number.py:177: error: Incompatible types in assignment (expression has type "float | Any | None", variable has type "float") [assignment]
+ homeassistant/components/zha/__init__.py:361: error: Invalid index type "dict[Any, Any] | Any" for "dict[str, int]"; expected type "str" [index]
+ homeassistant/components/netgear/config_flow.py:138: error: Argument "description_placeholders" to "async_show_form" of "ConfigFlow" has incompatible type "dict[str, bool | Any]"; expected "Mapping[str, str] | None" [arg-type]
scrapy (https://github.com/scrapy/scrapy)
- scrapy/utils/url.py:206: error: Returning Any from function declared to return "str" [no-any-return]
- scrapy/http/request/form.py:164: error: Returning Any from function declared to return "str" [no-any-return]
+ scrapy/statscollectors.py:87: error: Value of type variable "SupportsRichComparisonT" of "max" cannot be "Any | Any | None" [type-var]
+ scrapy/statscollectors.py:92: error: Value of type variable "SupportsRichComparisonT" of "min" cannot be "Any | Any | None" [type-var]
+ tests/test_http2_client_protocol.py:112: error: Need type annotation for "response" [var-annotated]
+ tests/test_http2_client_protocol.py:118: error: Unsupported target for indexed assignment ("str | dict[Any, Any] | Any") [index]
egglog-python (https://github.com/egraphs-good/egglog-python)
+ python/egglog/ipython_magic.py:39: error: Argument 1 to "join" of "str" has incompatible type "list[PrintFunctionSize | PrintAllFunctionsSize | ExtractVariants | ExtractBest | ProveExistsOutput | OverallStatistics | RunScheduleOutput | PrintFunctionOutput | UserDefinedOutput] | Any"; expected "Iterable[str]" [arg-type]
+ python/egglog/runtime.py:587: error: Argument 2 to "substitute_typevars_try_function" of "TypeConstraintSolver" has incompatible type "object"; expected "Callable[..., Any]" [arg-type]
discord.py (https://github.com/Rapptz/discord.py)
+ discord/ext/commands/context.py:1143: error: Incompatible types in assignment (expression has type "InteractionMessage", variable has type "WebhookMessage") [assignment]
+ discord/ext/commands/context.py:1145: error: Incompatible types in assignment (expression has type "InteractionMessage", variable has type "WebhookMessage") [assignment]
- discord/ext/commands/context.py:1139: error: No overload variant of "send" of "Webhook" matches argument types "dict[str, bool | str | Any | Embed | Sequence[Embed] | File | Sequence[File] | AllowedMentions | BaseView | Poll | None]", "bool" [call-overload]
- discord/ext/commands/context.py:1139: note: Possible overload variants:
- discord/ext/commands/context.py:1139: note: def send(self, *, username: str = ..., avatar_url: Any = ..., ephemeral: bool = ..., file: File = ..., files: Sequence[File] = ..., allowed_mentions: AllowedMentions = ..., view: LayoutView, wait: Literal[True], thread: Snowflake = ..., thread_name: str = ..., suppress_embeds: bool = ..., silent: bool = ..., applied_tags: list[ForumTag] = ...) -> Coroutine[Any, Any, WebhookMessage]
- discord/ext/commands/context.py:1139: note: def send(self, *, username: str = ..., avatar_url: Any = ..., ephemeral: bool = ..., file: File = ..., files: Sequence[File] = ..., allowed_mentions: AllowedMentions = ..., view: LayoutView, wait: Literal[False] = ..., thread: Snowflake = ..., thread_name: str = ..., suppress_embeds: bool = ..., silent: bool = ..., applied_tags: list[ForumTag] = ...) -> Coroutine[Any, Any, None]
- discord/ext/commands/context.py:1139: note: def send(self, content: str = ..., *, username: str = ..., avatar_url: Any = ..., tts: bool = ..., ephemeral: bool = ..., file: File = ..., files: Sequence[File] = ..., embed: Embed = ..., embeds: Sequence[Embed] = ..., allowed_mentions: AllowedMentions = ..., view: View = ..., thread: Snowflake = ..., thread_name: str = ..., wait: Literal[True], suppress_embeds: bool = ..., silent: bool = ..., applied_tags: list[ForumTag] = ..., poll: Poll = ...) -> Coroutine[Any, Any, WebhookMessage]
- discord/ext/commands/context.py:1139: note: def send(self, content: str = ..., *, username: str = ..., avatar_url: Any = ..., tts: bool = ..., ephemeral: bool = ..., file: File = ..., files: Sequence[File] = ..., embed: Embed = ..., embeds: Sequence[Embed] = ..., allowed_mentions: AllowedMentions = ..., view: View = ..., thread: Snowflake = ..., thread_name: str = ..., wait: Literal[False] = ..., suppress_embeds: bool = ..., silent: bool = ..., applied_tags: list[ForumTag] = ..., poll: Poll = ...) -> Coroutine[Any, Any, None]
- discord/ext/commands/context.py:1141: error: Argument 1 to "send_message" of "InteractionResponse" has incompatible type "**dict[str, bool | str | Any | Embed | Sequence[Embed] | File | Sequence[File] | AllowedMentions | BaseView | Poll | None]"; expected "File" [arg-type]
- discord/ext/commands/context.py:1141: error: Argument 1 to "send_message" of "InteractionResponse" has incompatible type "**dict[str, bool | str | Any | Embed | Sequence[Embed] | File | Sequence[File] | AllowedMentions | BaseView | Poll | None]"; expected "Sequence[File]" [arg-type]
- discord/ext/commands/context.py:1141: error: Argument 1 to "send_message" of "InteractionResponse" has incompatible type "**dict[str, bool | str | Any | Embed | Sequence[Embed] | File | Sequence[File] | AllowedMentions | BaseView | Poll | None]"; expected "LayoutView" [arg-type]
- discord/ext/commands/context.py:1141: error: Argument 1 to "send_message" of "InteractionResponse" has incompatible type "**dict[str, bool | str | Any | Embed | Sequence[Embed] | File | Sequence[File] | AllowedMentions | BaseView | Poll | None]"; expected "bool" [arg-type]
- discord/ext/commands/context.py:1141: error: Argument 1 to "send_message" of "InteractionResponse" has incompatible type "**dict[str, bool | str | Any | Embed | Sequence[Embed] | File | Sequence[File] | AllowedMentions | BaseView | Poll | None]"; expected "AllowedMentions" [arg-type]
- discord/ext/commands/context.py:1141: error: Argument 1 to "send_message" of "InteractionResponse" has incompatible type "**dict[str, bool | str | Any | Embed | Sequence[Embed] | File | Sequence[File] | AllowedMentions | BaseView | Poll | None]"; expected "float | None" [arg-type]
Tanjun (https://github.com/FasterSpeeding/Tanjun)
+ tanjun/annotations.py:2482: error: Not all union combinations were tried because there are too many unions [misc]
+ tanjun/annotations.py:2484: error: Argument "converters" to "add_argument" of "AbstractOptionParser" has incompatible type "Sequence[def (str, /, *Any, **Any) -> Coroutine[Any, Any, Any] | Any] | tuple[Callable[[str], Snowflake]] | tuple[Callable[..., Any], ...] | tuple[ToChannel]"; expected "Iterable[def (str, /, *Any, **Any) -> Coroutine[Any, Any, str] | str] | def (str, /, *Any, **Any) -> Coroutine[Any, Any, str] | str" [arg-type]
+ tanjun/annotations.py:2489: error: Argument "min_value" to "add_argument" of "AbstractOptionParser" has incompatible type "float | int | None"; expected "_CmpProto[str] | None" [arg-type]
+ tanjun/annotations.py:2490: error: Argument "max_value" to "add_argument" of "AbstractOptionParser" has incompatible type "float | int | None"; expected "_CmpProto[str] | None" [arg-type]
+ tanjun/annotations.py:2498: error: Not all union combinations were tried because there are too many unions [misc]
+ tanjun/annotations.py:2501: error: Argument "converters" to "add_option" of "AbstractOptionParser" has incompatible type "Sequence[def (str, /, *Any, **Any) -> Coroutine[Any, Any, Any] | Any] | tuple[Callable[[str], Snowflake]] | tuple[Callable[..., Any], ...] | tuple[ToChannel]"; expected "Iterable[def (str, /, *Any, **Any) -> Coroutine[Any, Any, str] | str] | def (str, /, *Any, **Any) -> Coroutine[Any, Any, str] | str" [arg-type]
+ tanjun/annotations.py:2506: error: Argument "min_value" to "add_option" of "AbstractOptionParser" has incompatible type "float | int | None"; expected "_CmpProto[str] | None" [arg-type]
+ tanjun/annotations.py:2507: error: Argument "max_value" to "add_option" of "AbstractOptionParser" has incompatible type "float | int | None"; expected "_CmpProto[str] | None" [arg-type]
pandera (https://github.com/pandera-dev/pandera)
+ pandera/backends/narwhals/container.py:289: error: Argument 1 to "run_index_checks" of "DataFrameSchemaBackend" has incompatible type "*tuple[Any | DataFrameSchema | bool, ...]"; expected "bool" [arg-type]
+ pandera/backends/narwhals/container.py:289: note: Error code "arg-type" not covered by "type: ignore[operator]" comment
+ pandera/backends/narwhals/container.py:289: error: Argument 1 to "run_schema_component_checks" of "DataFrameSchemaBackend" has incompatible type "*tuple[Any | DataFrameSchema | bool, ...]"; expected "list[Any]" [arg-type]
+ pandera/backends/narwhals/container.py:289: error: Argument 1 to "run_schema_component_checks" of "DataFrameSchemaBackend" has incompatible type "*tuple[Any | DataFrameSchema | bool, ...]"; expected "bool" [arg-type]
+ pandera/backends/ibis/container.py:94: error: Argument 1 to "run_schema_component_checks" of "DataFrameSchemaBackend" has incompatible type "*tuple[Any | DataFrameSchema | bool | ColumnInfo, ...]"; expected "Iterable[Any]" [arg-type]
+ pandera/backends/ibis/container.py:94: error: Argument 1 to "run_schema_component_checks" of "DataFrameSchemaBackend" has incompatible type "*tuple[Any | DataFrameSchema | bool | ColumnInfo, ...]"; expected "bool" [arg-type]
+ pandera/backends/polars/container.py:138: error: Argument 1 to "run_schema_component_checks" of "DataFrameSchemaBackend" has incompatible type "*tuple[Any | DataFrameSchema | bool, ...]"; expected "list[Any]" [arg-type]
+ pandera/backends/polars/container.py:138: note: Error code "arg-type" not covered by "type: ignore[operator]" comment
+ pandera/backends/polars/container.py:138: error: Argument 1 to "run_schema_component_checks" of "DataFrameSchemaBackend" has incompatible type "*tuple[Any | DataFrameSchema | bool, ...]"; expected "bool" [arg-type]
pydantic (https://github.com/pydantic/pydantic)
- pydantic/_internal/_model_construction.py:366: error: No overload variant of "get_default" of "ModelPrivateAttr" matches argument types "bool", "dict[Any, Any]" [call-overload]
+ pydantic/_internal/_model_construction.py:366: error: No overload variant of "get_default" of "ModelPrivateAttr" matches argument types "bool", "dict[str | Any, Any]" [call-overload]
pyppeteer (https://github.com/pyppeteer/pyppeteer)
+ pyppeteer/network_manager.py:707: error: Need type annotation for "_hash" [var-annotated]
+ pyppeteer/network_manager.py:727: error: Unsupported target for indexed assignment ("dict[Any, Any] | Any | None") [index]
- pyppeteer/launcher.py:149: error: Argument 2 to "Popen" has incompatible type "**dict[str, Any | None]"; expected "int" [arg-type]
- pyppeteer/launcher.py:149: error: Argument 2 to "Popen" has incompatible type "**dict[str, Any | None]"; expected "bool" [arg-type]
- pyppeteer/launcher.py:149: error: Argument 2 to "Popen" has incompatible type "**dict[str, Any | None]"; expected "Collection[int]" [arg-type]
- pyppeteer/launcher.py:149: error: Argument 2 to "Popen" has incompatible type "**dict[str, Any | None]"; expected "str" [arg-type]
rotki (https://github.com/rotki/rotki)
+ rotkehlchen/tests/api/test_user_assets.py:101: error: Argument "json" to "put" has incompatible type "dict[str, object]"; expected "JsonType" [arg-type]
+ rotkehlchen/tests/api/test_user_assets.py:488: error: Argument "json" to "put" has incompatible type "dict[str, object]"; expected "JsonType" [arg-type]
+ rotkehlchen/chain/evm/decoding/decoder.py:581: error: Argument 6 to "decode_safely" has incompatible type "*tuple[DecoderContext | Any, ...]"; expected "tuple[Any]" [arg-type]
+ rotkehlchen/chain/solana/decoding/decoder.py:629: error: Argument 6 to "decode_safely" has incompatible type "*tuple[SolanaEventDecoderContext | SolanaDecoderContext | Any, ...]"; expected "tuple[Any]" [arg-type]
+ rotkehlchen/data_import/utils.py:80: error: Item "bool" of "bool | list[Any] | Any" has no attribute "append" [union-attr]
+ rotkehlchen/db/unresolved_conflicts.py:110: error: Unsupported target for indexed assignment ("str | Any | None") [index]
pytest-autoprofile (https://gitlab.com/TTsangSC/pytest-autoprofile)
+ src/pytest_autoprofile/_xdoctest.py:260: error: Incompatible return value type (got "tuple[SimpleNamespace | Any, ...]", expected "tuple[None, None, None] | tuple[type[Exc], Exc, SimpleNamespace | TracebackType]") [return-value]
cwltool (https://github.com/common-workflow-language/cwltool)
+ cwltool/command_line_tool.py: note: In member "collect_output_ports" of class "CommandLineTool":
+ cwltool/command_line_tool.py:1297:46: error: Argument 1 to "shortname" has incompatible type "str | int | float | CWLFileType | CWLDirectoryType | MutableSequence[CWLOutputType | None] | MutableMapping[str, CWLOutputType | None] | Any | None"; expected "str" [arg-type]
beartype (https://github.com/beartype/beartype)
+ beartype/_conf/confmain.py:977: error: Incompatible types in assignment (expression has type "object", variable has type "BeartypeDecorPlace") [assignment]
+ beartype/_conf/confmain.py:979: error: Incompatible types in assignment (expression has type "object", variable has type "BeartypeDecorPlace") [assignment]
+ beartype/_conf/confmain.py:981: error: Incompatible types in assignment (expression has type "object", variable has type "bool") [assignment]
+ beartype/_conf/confmain.py:982: error: Incompatible types in assignment (expression has type "object", variable has type "Collection[str]") [assignment]
+ beartype/_conf/confmain.py:984: error: Incompatible types in assignment (expression has type "object", variable has type "FrozenDict[Any, Any]") [assignment]
+ beartype/_conf/confmain.py:985: error: Incompatible types in assignment (expression has type "object", variable has type "bool | None") [assignment]
+ beartype/_conf/confmain.py:986: error: Incompatible types in assignment (expression has type "object", variable has type "bool") [assignment]
+ beartype/_conf/confmain.py:987: error: Incompatible types in assignment (expression has type "object", variable has type "bool") [assignment]
+ beartype/_conf/confmain.py:988: error: Incompatible types in assignment (expression has type "object", variable has type "bool") [assignment]
+ beartype/_conf/confmain.py:989: error: Incompatible types in assignment (expression has type "object", variable has type "bool") [assignment]
+ beartype/_conf/confmain.py:990: error: Incompatible types in assignment (expression has type "object", variable has type "BeartypeStrategy") [assignment]
+ beartype/_conf/confmain.py:991: error: Incompatible types in assignment (expression has type "object", variable has type "type[Exception]") [assignment]
+ beartype/_conf/confmain.py:992: error: Incompatible types in assignment (expression has type "object", variable has type "type[Exception]") [assignment]
+ beartype/_conf/confmain.py:993: error: Incompatible types in assignment (expression has type "object", variable has type "type[Exception]") [assignment]
+ beartype/_conf/confmain.py:994: error: Incompatible types in assignment (expression has type "object", variable has type "type[Exception] | None") [assignment]
... (truncated 431 lines) ...``` |
Currently, we have
join(Any, X) = Any, but this causes various false negatives. Some of these false negatives will be exacerbated by #22286. This PR makesjoin(Any, X) = X | Any(with obvious exceptions forobject,Never, etc).Note I also simplify/unify logic for callables by deleting
combine_similar_callables().Since this fixes false negatives I expect some fallout, but hopefully not too big.
cc @hauntsaninja @JukkaL