Skip to content

Conversation

@kumar-ayan
Copy link

This commit fixes an issue where list constructions (literals, comprehensions) assigned to Union types (e.g., list[str] | list[int]) failed to correctly infer the specific list type, often defaulting to a generic or incorrect type.

Changes:

  • mypy/checkexpr.py:
    • Updated check_callable_call to split Union contexts and infer specialized candidates for each Union item.
    • Added candidate filtering using is_subtype to discard generic candidates that shouldn't match specialized contexts, preventing regressions.
    • Fixed a crash in type_overrides_set context manager when handling duplicate expressions.
  • mypy/build.py:
    • Fixed CACHE_VERSION import and usage to prevent TypeError during build/tests.

This commit fixes an issue where list constructions (literals, comprehensions) assigned to Union types (e.g., list[str] | list[int]) failed to correctly infer the specific list type, often defaulting to a generic or incorrect type.

Changes:
- mypy/checkexpr.py:
  - Updated check_callable_call to split Union contexts and infer specialized candidates for each Union item.
  - Added candidate filtering using is_subtype to discard generic candidates that shouldn't match specialized contexts, preventing regressions.
  - Fixed a crash in type_overrides_set context manager when handling duplicate expressions.
- mypy/build.py:
  - Fixed CACHE_VERSION import and usage to prevent TypeError during build/tests.
@kumar-ayan kumar-ayan closed this Jan 3, 2026
@kumar-ayan kumar-ayan deleted the fix/list-union-inference branch January 3, 2026 17:34
@kumar-ayan kumar-ayan restored the fix/list-union-inference branch January 3, 2026 17:35
@kumar-ayan kumar-ayan reopened this Jan 3, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 3, 2026

Diff from mypy_primer, showing the effect of this PR on open source code:

beartype (https://github.com/beartype/beartype)
+ beartype/_util/module/utilmodimport.py:460: error: No overload variant of "get" of "dict" matches argument types "str", "Iota"  [call-overload]
+ beartype/_util/module/utilmodimport.py:460: note: Possible overload variant:
+ beartype/_util/module/utilmodimport.py:460: note:     def get(self, str, type, /) -> type
- beartype/claw/_ast/_kind/clawastimport.py:622: error: Unused "type: ignore" comment  [unused-ignore]
- beartype/claw/_ast/_kind/clawastimport.py:631: error: Unused "type: ignore" comment  [unused-ignore]
+ beartype/claw/_ast/_kind/clawastimport.py:586: error: No overload variant of "get" of "dict" matches argument types "str | Any", "Iota"  [call-overload]
+ beartype/claw/_ast/_kind/clawastimport.py:586: note: Possible overload variant:
+ beartype/claw/_ast/_kind/clawastimport.py:586: note:     def get(self, str, dict[str, BeartypeDecorPlaceSubtrie] | None, /) -> dict[str, BeartypeDecorPlaceSubtrie] | None

hydpy (https://github.com/hydpy-dev/hydpy)
+ hydpy/core/auxfiletools.py:556: error: No overload variant of "deepcopy" matches argument type "Parameter"  [call-overload]
+ hydpy/core/auxfiletools.py:556: note: Possible overload variant:
+ hydpy/core/auxfiletools.py:556: note:     def deepcopy(x: KeywordArguments[Any], memo: dict[int, Any] | None = ..., _nil: Any = ...) -> KeywordArguments[Any]

optuna (https://github.com/optuna/optuna)
+ optuna/importance/_ped_anova/scott_parzen_estimator.py:70: error: No overload variant of "min" matches argument types "int", "Any"  [call-overload]
+ optuna/importance/_ped_anova/scott_parzen_estimator.py:70: note: Possible overload variants:
+ optuna/importance/_ped_anova/scott_parzen_estimator.py:70: note:     def min(ndarray[tuple[Any, ...], dtype[integer[Any] | numpy.bool[builtins.bool]]], ndarray[tuple[Any, ...], dtype[integer[Any] | numpy.bool[builtins.bool]]], /, *_args: ndarray[tuple[Any, ...], dtype[integer[Any] | numpy.bool[builtins.bool]]], key: None = ...) -> ndarray[tuple[Any, ...], dtype[integer[Any] | numpy.bool[builtins.bool]]]
+ optuna/importance/_ped_anova/scott_parzen_estimator.py:70: note:     def min(tuple[ndarray[tuple[Any, ...], dtype[integer[Any] | numpy.bool[builtins.bool]]], ...], tuple[ndarray[tuple[Any, ...], dtype[integer[Any] | numpy.bool[builtins.bool]]], ...], /, *_args: tuple[ndarray[tuple[Any, ...], dtype[integer[Any] | numpy.bool[builtins.bool]]], ...], key: None = ...) -> tuple[ndarray[tuple[Any, ...], dtype[integer[Any] | numpy.bool[builtins.bool]]], ...]

spark (https://github.com/apache/spark)
+ python/pyspark/sql/readwriter.py:314: error: Unused "type: ignore" comment  [unused-ignore]
+ python/pyspark/sql/readwriter.py:314: error: No overload variant of <list> matches argument type "list[str]"  [call-overload]
+ python/pyspark/sql/readwriter.py:314: note: Error code "call-overload" not covered by "type: ignore" comment
+ python/pyspark/sql/readwriter.py:314: note: Possible overload variant:
+ python/pyspark/sql/readwriter.py:314: note:     def <list>(*str) -> list[str]
+ python/pyspark/sql/classic/dataframe.py:744: error: Unused "type: ignore" comment  [unused-ignore]
+ python/pyspark/sql/classic/dataframe.py:751: error: Unsupported left operand type for & ("list[str]")  [operator]
+ python/pyspark/sql/classic/dataframe.py:751: error: Argument 2 to "reduce" has incompatible type "list[Column]"; expected "Iterable[list[str]]"  [arg-type]
+ python/pyspark/sql/classic/dataframe.py:752: error: "list[str]" has no attribute "_jc"  [attr-defined]
+ python/pyspark/sql/classic/dataframe.py:873: error: Unused "type: ignore" comment  [unused-ignore]
+ python/pyspark/sql/classic/dataframe.py:880: error: Unsupported left operand type for & ("list[str]")  [operator]
+ python/pyspark/sql/classic/dataframe.py:880: error: Argument 2 to "reduce" has incompatible type "list[Column]"; expected "Iterable[list[str]]"  [arg-type]
+ python/pyspark/sql/classic/dataframe.py:881: error: "list[str]" has no attribute "_jc"  [attr-defined]
+ python/pyspark/pandas/frame.py:3675: error: Argument 1 to "reduce" has incompatible type "Callable[[Series[Any], Series[Any]], Series[Any] | Index]"; expected "Callable[[Series[Any], Series[Any]], Series[Any]]"  [arg-type]
+ python/pyspark/pandas/frame.py:3675: error: Incompatible return value type (got "Series[Any] | Index", expected "Series[Any]")  [return-value]
+ python/pyspark/pandas/namespace.py:342: error: Unused "type: ignore" comment  [unused-ignore]
+ python/pyspark/pandas/groupby.py:2182: error: No overload variant of "filter" of "SeriesGroupBy" matches argument type "Callable[[FrameLike], FrameLike]"  [call-overload]
+ python/pyspark/pandas/groupby.py:2182: note: Possible overload variants:
+ python/pyspark/pandas/groupby.py:2182: note:     def [P`20430] filter(self, func: Callable[[Series[Any], **P], Any] | str, dropna: bool = ..., *args: P.args, **kwargs: P.kwargs) -> Series[Any]
+ python/pyspark/sql/connect/client/core.py:716: error: Argument 2 to "getenv" has incompatible type "None"; expected "str"  [arg-type]

tornado (https://github.com/tornadoweb/tornado)
+ tornado/websocket.py:265: error: No overload variant of "get" of "Mapping" matches argument types "str", "None"  [call-overload]
+ tornado/websocket.py:265: note: Possible overload variant:
+ tornado/websocket.py:265: note:     def get(self, str, str, /) -> str
+ tornado/websocket.py:1006: error: No overload variant of "get" of "Mapping" matches argument types "str", "None"  [call-overload]
+ tornado/websocket.py:1006: note: Possible overload variant:
+ tornado/websocket.py:1006: note:     def get(self, str, str, /) -> str

prefect (https://github.com/PrefectHQ/prefect)
+ src/prefect/task_runs.py:217: error: No overload variant of "create_call" matches argument type "Any"  [call-overload]
+ src/prefect/task_runs.py:217: note: Possible overload variants:
+ src/prefect/task_runs.py:217: note:     def [P`5668] create_call(def (*Any, **Any) -> T? | Awaitable[T?], /, *args: P.args, **kwargs: P.kwargs) -> Call
+ src/prefect/_waiters.py:206: error: No overload variant of "create_call" matches argument type "Any"  [call-overload]
+ src/prefect/_waiters.py:206: note: Possible overload variants:
+ src/prefect/_waiters.py:206: note:     def [P`5703] create_call(def (*Any, **Any) -> T? | Awaitable[T?], /, *args: P.args, **kwargs: P.kwargs) -> Call
+ src/prefect/runner/storage.py:217: error: Argument 1 to "deepcopy" has incompatible type "GitCredentials | Block | dict[str, Any]"; expected "dict[str, Any]"  [arg-type]
+ src/prefect/runner/storage.py:264: error: Argument 1 to "deepcopy" has incompatible type "GitCredentials | Block | dict[str, Any]"; expected "dict[str, Any]"  [arg-type]
- src/prefect/runner/storage.py:222: error: TypedDict key must be a string literal; expected one of ("username", "access_token")  [literal-required]
- src/prefect/runner/storage.py:224: error: TypedDict key must be a string literal; expected one of ("username", "access_token")  [literal-required]
- src/prefect/runner/storage.py:268: error: TypedDict key must be a string literal; expected one of ("username", "access_token")  [literal-required]
- src/prefect/runner/storage.py:270: error: TypedDict key must be a string literal; expected one of ("username", "access_token")  [literal-required]
- src/prefect/deployments/runner.py:641: error: Incompatible types in assignment (expression has type "list[Iterable[str] | Iterable[int | float | timedelta] | int | float | timedelta | None]", variable has type "Iterable[str] | Iterable[int | float | timedelta] | int | float | timedelta | None")  [assignment]
+ src/prefect/deployments/runner.py:641: error: List item 0 has incompatible type "Iterable[str] | Iterable[int | float | timedelta] | int | float | timedelta | None"; expected "int | float | timedelta"  [list-item]
- src/prefect/cli/deploy/_core.py:361: error: Argument 1 to "_PullStepStorage" has incompatible type "list[Any] | type[NotSet]"; expected "list[dict[str, Any]]"  [arg-type]
+ src/prefect/cli/deploy/_core.py:361: error: Argument 1 to "_PullStepStorage" has incompatible type "Any | type[NotSet]"; expected "list[dict[str, Any]]"  [arg-type]
- src/prefect/cli/deploy/_core.py:421: error: Argument "pull_steps" to "_save_deployment_to_prefect_file" has incompatible type "list[Any] | type[NotSet] | None"; expected "list[dict[str, Any]] | None"  [arg-type]
+ src/prefect/cli/deploy/_core.py:421: error: Argument "pull_steps" to "_save_deployment_to_prefect_file" has incompatible type "Any | type[NotSet] | None"; expected "list[dict[str, Any]] | None"  [arg-type]

mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ bson/__init__.py:1332: error: Argument 2 to "_bson_to_dict" has incompatible type "CodecOptions[Any] | CodecOptions[Any]"; expected "CodecOptions[dict[str, Any]]"  [arg-type]
+ bson/__init__.py:1378: error: Unused "type: ignore" comment  [unused-ignore]
+ bson/__init__.py:1378: error: Argument 2 to "_bson_to_dict" has incompatible type "CodecOptions[_DocumentType] | CodecOptions[dict[str, Any]]"; expected "CodecOptions[dict[str, Any]]"  [arg-type]
+ bson/__init__.py:1378: note: Error code "arg-type" not covered by "type: ignore" comment
+ pymongo/auth_oidc_shared.py:33: error: No overload variant of "field" matches argument type "None"  [call-overload]
+ pymongo/auth_oidc_shared.py:33: note: Possible overload variant:
+ pymongo/auth_oidc_shared.py:33: note:     def field(*, default: list[str], default_factory: Literal[_MISSING_TYPE.MISSING] = ..., init: bool = ..., repr: bool = ..., hash: bool | None = ..., compare: bool = ..., metadata: Mapping[Any, Any] | None = ..., kw_only: bool | Literal[_MISSING_TYPE.MISSING] = ..., doc: str | None = ...) -> list[str]
+ pymongo/synchronous/change_stream.py:146: error: Argument 1 to "deepcopy" has incompatible type "Mapping[str, Any] | None"; expected "Mapping[str, Any]"  [arg-type]
+ pymongo/asynchronous/change_stream.py:146: error: Argument 1 to "deepcopy" has incompatible type "Mapping[str, Any] | None"; expected "Mapping[str, Any]"  [arg-type]

pydantic (https://github.com/pydantic/pydantic)
+ pydantic/deprecated/copy_internals.py:110: error: Argument 1 to "deepcopy" has incompatible type "dict[str, Any] | None"; expected "dict[str, Any]"  [arg-type]
+ pydantic/deprecated/copy_internals.py:111: error: Argument 1 to "deepcopy" has incompatible type "dict[str, Any] | None"; expected "dict[str, Any]"  [arg-type]

mkosi (https://github.com/systemd/mkosi)
+ mkosi/user.py:45:23: error: No overload variant of "getenv" matches argument types "str", "Path"  [call-overload]
+ mkosi/user.py:45:23: note: Possible overload variant:
+ mkosi/user.py:45:23: note:     def getenv(key: str, default: str) -> str
+ mkosi/mounts.py:58:21: error: Argument 1 to "enter_context" of "_BaseExitStack" has incompatible type "TemporaryDirectory[str]"; expected "AbstractContextManager[PathLike[str], bool | None]"  [arg-type]
+ mkosi/mounts.py:69:17: error: Argument 1 to "enter_context" of "_BaseExitStack" has incompatible type "TemporaryDirectory[str]"; expected "AbstractContextManager[PathLike[str], bool | None]"  [arg-type]
+ mkosi/mounts.py:110:29: error: Argument 1 to "enter_context" of "_BaseExitStack" has incompatible type "TemporaryDirectory[str]"; expected "AbstractContextManager[PathLike[str], bool | None]"  [arg-type]
+ mkosi/mounts.py:120:25: error: Argument 1 to "enter_context" of "_BaseExitStack" has incompatible type "TemporaryDirectory[str]"; expected "AbstractContextManager[PathLike[str], bool | None]"  [arg-type]
+ mkosi/qemu.py:865:34: error: Argument 1 to "enter_context" of "_BaseExitStack" has incompatible type "TemporaryDirectory[str]"; expected "AbstractContextManager[PathLike[str], bool | None]"  [arg-type]
+ mkosi/qemu.py:1382:46: error: Argument 1 to "enter_context" of "_BaseExitStack" has incompatible type "TemporaryDirectory[str]"; expected "AbstractContextManager[PathLike[str], bool | None]"  [arg-type]
+ mkosi/__init__.py:563:21: error: Argument 1 to "enter_context" of "_BaseExitStack" has incompatible type "TemporaryDirectory[str]"; expected "AbstractContextManager[PathLike[str], bool | None]"  [arg-type]
+ mkosi/__init__.py:2542:17: error: No overload variant of "get" of "dict" matches argument types "str", "Path"  [call-overload]
+ mkosi/__init__.py:2542:17: note: Possible overload variant:
+ mkosi/__init__.py:2542:17: note:     def get(self, str, str, /) -> str
+ mkosi/__init__.py:4811:17: error: Argument 1 to "enter_context" of "_BaseExitStack" has incompatible type "TemporaryDirectory[str]"; expected "AbstractContextManager[PathLike[str], bool | None]"  [arg-type]
+ mkosi/__init__.py:4827:17: error: Argument 1 to "enter_context" of "_BaseExitStack" has incompatible type "TemporaryDirectory[str]"; expected "AbstractContextManager[PathLike[str], bool | None]"  [arg-type]
+ mkosi/__init__.py:5217:21: error: Argument 1 to "enter_context" of "_BaseExitStack" has incompatible type "TemporaryDirectory[str]"; expected "AbstractContextManager[PathLike[str], bool | None]"  [arg-type]

bandersnatch (https://github.com/pypa/bandersnatch)
+ src/bandersnatch/verify.py: note: In function "metadata_verify":
+ src/bandersnatch/verify.py:271: error: No overload variant of "getfloat" of "RawConfigParser" matches argument types "str", "str", "None"  [call-overload]
+ src/bandersnatch/verify.py:271: note: Possible overload variant:
+ src/bandersnatch/verify.py:271: note:     def getfloat(self, section: str, option: str, *, raw: bool = ..., vars: Mapping[str, str] | None = ..., fallback: float = ...) -> float
+ src/bandersnatch/main.py: note: In function "async_main":
+ src/bandersnatch/main.py:160: error: No overload variant of "getfloat" of "RawConfigParser" matches argument types "str", "str", "None"  [call-overload]
+ src/bandersnatch/main.py:160: note: Possible overload variant:
+ src/bandersnatch/main.py:160: note:     def getfloat(self, section: str, option: str, *, raw: bool = ..., vars: Mapping[str, str] | None = ..., fallback: float = ...) -> float

cibuildwheel (https://github.com/pypa/cibuildwheel)
+ cibuildwheel/util/file.py:19: error: No overload variant of "get" of "_Environ" matches argument types "str", "Path"  [call-overload]
+ cibuildwheel/util/file.py:19: note: Possible overload variant:
+ cibuildwheel/util/file.py:19: note:     def get(self, key: str, default: str) -> str
+ cibuildwheel/platforms/android.py:356: error: No overload variant of "copy" matches argument types "Path", "Path"  [call-overload]
+ cibuildwheel/platforms/android.py:356: note: Possible overload variant:
+ cibuildwheel/platforms/android.py:356: note:     def copy(src: str | PathLike[str], dst: str, *, follow_symlinks: bool = ...) -> str

aiohttp (https://github.com/aio-libs/aiohttp)
+ aiohttp/multipart.py:279:50: error: No overload variant of "get" of "MultiDictProxy" matches argument types "istr", "None"  [call-overload]
+ aiohttp/multipart.py:279:50: note: Possible overload variant:
+ aiohttp/multipart.py:279:50: note:     def get(self, str, /, default: str) -> str
+ aiohttp/multipart.py:279:50: note: See https://mypy.rtfd.io/en/stable/_refs.html#code-call-overload for more info

colour (https://github.com/colour-science/colour)
+ colour/algebra/common.py:221: error: Argument 1 to "optional" has incompatible type "Literal['Numpy', 'Ignore', 'Warning', 'Raise', 'Ignore Zero Conversion', 'Warning Zero Conversion', 'Ignore Limit Conversion', 'Warning Limit Conversion', 'Replace With Epsilon', 'Warning Replace With Epsilon'] | None"; expected "Literal['Numpy'] | None"  [arg-type]
+ colour/algebra/common.py:221: error: Argument 2 to "optional" has incompatible type "Literal['Numpy', 'Ignore', 'Warning', 'Raise', 'Ignore Zero Conversion', 'Warning Zero Conversion', 'Ignore Limit Conversion', 'Warning Limit Conversion', 'Replace With Epsilon', 'Warning Replace With Epsilon']"; expected "Literal['Numpy']"  [arg-type]
- colour/io/luts/operator.py:257: error: Incompatible types in assignment (expression has type "object", variable has type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]")  [assignment]
- colour/io/luts/operator.py:259: error: Incompatible types in assignment (expression has type "object", variable has type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]")  [assignment]
+ colour/io/luts/operator.py:257: error: Argument 1 to "optional" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | None"; expected "_SupportsArray[dtype[Any]] | None"  [arg-type]
+ colour/io/luts/operator.py:259: error: Argument 1 to "optional" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | None"; expected "_SupportsArray[dtype[Any]] | None"  [arg-type]
- colour/io/luts/lut.py:161: error: Incompatible types in assignment (expression has type "object", variable has type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]")  [assignment]
- colour/io/luts/lut.py:163: error: Incompatible types in assignment (expression has type "object", variable has type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | str | _NestedSequence[complex | bytes | str]")  [assignment]
+ colour/io/luts/lut.py:161: error: Argument 1 to "optional" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | None"; expected "_SupportsArray[dtype[Any]] | None"  [arg-type]
+ colour/io/luts/lut.py:163: error: Argument 1 to "optional" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | None"; expected "_SupportsArray[dtype[Any]] | None"  [arg-type]
- colour/io/luts/lut.py:1419: error: Argument 1 to "tile" has incompatible type "Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | None"; expected "_SupportsArray[dtype[signedinteger[_8Bit] | signedinteger[_16Bit] | signedinteger[_32Bit] | signedinteger[_64Bit] | unsignedinteger[_8Bit] | unsignedinteger[_16Bit] | unsignedinteger[_32Bit] | unsignedinteger[_64Bit] | Any]] | _NestedSequence[_SupportsArray[dtype[signedinteger[_8Bit] | signedinteger[_16Bit] | signedinteger[_32Bit] | signedinteger[_64Bit] | unsignedinteger[_8Bit] | unsignedinteger[_16Bit] | unsignedinteger[_32Bit] | unsignedinteger[_64Bit] | Any]]]"  [arg-type]
+ colour/io/luts/lut.py:1433: error: No overload variant of "pad" matches argument types "ndarray[Any, Any]", "tuple[int, Any | signedinteger[_8Bit] | signedinteger[_16Bit] | signedinteger[_32Bit] | signedinteger[_64Bit] | unsignedinteger[_8Bit] | unsignedinteger[_16Bit] | unsignedinteger[_32Bit] | unsignedinteger[_64Bit]]", "str", "float"  [call-overload]
+ colour/io/luts/lut.py:1433: note: Possible overload variants:
+ colour/io/luts/lut.py:1433: note:     def [_ScalarT: generic[Any]] pad(array: _SupportsArray[dtype[_ScalarT]] | _NestedSequence[_SupportsArray[dtype[_ScalarT]]], pad_width: _SupportsArray[dtype[integer[Any]]] | _NestedSequence[_SupportsArray[dtype[integer[Any]]]] | int | _NestedSequence[int], mode: Literal['constant', 'edge', 'linear_ramp', 'maximum', 'mean', 'median', 'minimum', 'reflect', 'symmetric', 'wrap', 'empty'] = ..., *, stat_length: _SupportsArray[dtype[integer[Any]]] | _NestedSequence[_SupportsArray[dtype[integer[Any]]]] | int | _NestedSequence[int] | None = ..., constant_values: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] = ..., end_values: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] = ..., reflect_type: Literal['odd', 'even'] = ...) -> ndarray[tuple[Any, ...], dtype[_ScalarT]]
+ colour/io/luts/lut.py:1433: note:     def pad(array: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str], pad_width: _SupportsArray[dtype[integer[Any]]] | _NestedSequence[_SupportsArray[dtype[integer[Any]]]] | int | _NestedSequence[int], mode: Literal['constant', 'edge', 'linear_ramp', 'maximum', 'mean', 'median', 'minimum', 'reflect', 'symmetric', 'wrap', 'empty'] = ..., *, stat_length: _SupportsArray[dtype[integer[Any]]] | _NestedSequence[_SupportsArray[dtype[integer[Any]]]] | int | _NestedSequence[int] | None = ..., constant_values: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] = ..., end_values: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] = ..., reflect_type: Literal['odd', 'even'] = ...) -> ndarray[tuple[Any, ...], dtype[Any]]
+ colour/io/luts/lut.py:1433: note:     def [_ScalarT: generic[Any]] pad(array: _SupportsArray[dtype[_ScalarT]] | _NestedSequence[_SupportsArray[dtype[_ScalarT]]], pad_width: _SupportsArray[dtype[integer[Any]]] | _NestedSequence[_SupportsArray[dtype[integer[Any]]]] | int | _NestedSequence[int], mode: _ModeFunc, **kwargs: Any) -> ndarray[tuple[Any, ...], dtype[_ScalarT]]
+ colour/io/luts/lut.py:1433: note:     def pad(array: Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str], pad_width: _SupportsArray[dtype[integer[Any]]] | _NestedSequence[_SupportsArray[dtype[integer[Any]]]] | int | _NestedSequence[int], mode: _ModeFunc, **kwargs: Any) -> ndarray[tuple[Any, ...], dtype[Any]]
+ colour/difference/delta_e.py:264: error: Argument "default_factory" to "field" has incompatible type "Callable[[], None]"; expected "Callable[[], ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]]"  [arg-type]
+ colour/difference/delta_e.py:264: error: Incompatible return value type (got "None", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]")  [return-value]
+ colour/difference/delta_e.py:265: error: Argument "default_factory" to "field" has incompatible type "Callable[[], None]"; expected "Callable[[], ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]]"  [arg-type]
+ colour/difference/delta_e.py:265: error: Incompatible return value type (got "None", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]")  [return-value]
+ colour/difference/delta_e.py:266: error: Argument "default_factory" to "field" has incompatible type "Callable[[], None]"; expected "Callable[[], ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]]"  [arg-type]
+ colour/difference/delta_e.py:266: error: Incompatible return value type (got "None", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]")  [return-value]
+ colour/difference/delta_e.py:267: error: Argument "default_factory" to "field" has incompatible type "Callable[[], None]"; expected "Callable[[], ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]]"  [arg-type]
+ colour/difference/delta_e.py:267: error: Incompatible return value type (got "None", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]")  [return-value]
+ colour/difference/delta_e.py:268: error: Argument "default_factory" to "field" has incompatible type "Callable[[], None]"; expected "Callable[[], ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]]"  [arg-type]
+ colour/difference/delta_e.py:268: error: Incompatible return value type (got "None", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]")  [return-value]
+ colour/difference/delta_e.py:269: error: Argument "default_factory" to "field" has incompatible type "Callable[[], None]"; expected "Callable[[], ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]]"  [arg-type]
+ colour/difference/delta_e.py:269: error: Incompatible return value type (got "None", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]")  [return-value]
+ colour/difference/delta_e.py:270: error: Argument "default_factory" to "field" has incompatible type "Callable[[], None]"; expected "Callable[[], ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]]"  [arg-type]
+ colour/difference/delta_e.py:270: error: Incompatible return value type (got "None", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]")  [return-value]
+ colour/corresponding/datasets/breneman1987.py:82: error: Argument "default_factory" to "field" has incompatible type "Callable[[], None]"; expected "Callable[[], ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]]"  [arg-type]
+ colour/corresponding/datasets/breneman1987.py:82: error: Incompatible return value type (got "None", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]")  [return-value]
+ colour/corresponding/datasets/breneman1987.py:83: error: Argument "default_factory" to "field" has incompatible type "Callable[[], None]"; expected "Callable[[], ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]]"  [arg-type]
+ colour/corresponding/datasets/breneman1987.py:83: error: Incompatible return value type (got "None", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]")  [return-value]
+ colour/corresponding/datasets/breneman1987.py:84: error: Argument "default_factory" to "field" has incompatible type "Callable[[], None]"; expected "Callable[[], ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]]"  [arg-type]
+ colour/corresponding/datasets/breneman1987.py:84: error: Incompatible return value type (got "None", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]")  [return-value]
+ colour/corresponding/datasets/breneman1987.py:126: error: Argument "default_factory" to "field" has incompatible type "Callable[[], None]"; expected "Callable[[], ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]]"  [arg-type]
+ colour/corresponding/datasets/breneman1987.py:126: error: Incompatible return value type (got "None", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]")  [return-value]
+ colour/corresponding/datasets/breneman1987.py:127: error: Argument "default_factory" to "field" has incompatible type "Callable[[], None]"; expected "Callable[[], ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]]"  [arg-type]
+ colour/corresponding/datasets/breneman1987.py:127: error: Incompatible return value type (got "None", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]")  [return-value]
+ colour/corresponding/datasets/breneman1987.py:128: error: Argument "default_factory" to "field" has incompatible type "Callable[[], None]"; expected "Callable[[], ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]]"  [arg-type]
+ colour/corresponding/datasets/breneman1987.py:128: error: Incompatible return value type (got "None", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]")  [return-value]
+ colour/appearance/llab.py:206: error: Argument "default_factory" to "field" has incompatible type "Callable[[], None]"; expected "Callable[[], ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]]"  [arg-type]
+ colour/appearance/llab.py:206: error: Incompatible return value type (got "None", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]")  [return-value]
+ colour/appearance/llab.py:207: error: Argument "default_factory" to "field" has incompatible type "Callable[[], None]"; expected "Callable[[], ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]]"  [arg-type]
+ colour/appearance/llab.py:207: error: Incompatible return value type (got "None", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]")  [return-value]
+ colour/appearance/llab.py:208: error: Argument "default_factory" to "field" has incompatible type "Callable[[], None]"; expected "Callable[[], ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]]"  [arg-type]
+ colour/appearance/llab.py:208: error: Incompatible return value type (got "None", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]")  [return-value]
+ colour/appearance/llab.py:209: error: Argument "default_factory" to "field" has incompatible type "Callable[[], None]"; expected "Callable[[], ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]]"  [arg-type]
+ colour/appearance/llab.py:209: error: Incompatible return value type (got "None", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]")  [return-value]
+ colour/appearance/llab.py:210: error: Argument "default_factory" to "field" has incompatible type "Callable[[], None]"; expected "Callable[[], ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]]"  [arg-type]
+ colour/appearance/llab.py:210: error: Incompatible return value type (got "None", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]")  [return-value]
+ colour/appearance/llab.py:211: error: Argument "default_factory" to "field" has incompatible type "Callable[[], None]"; expected "Callable[[], ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]]"  [arg-type]
+ colour/appearance/llab.py:211: error: Incompatible return value type (got "None", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]")  [return-value]
+ colour/appearance/llab.py:212: error: Argument "default_factory" to "field" has incompatible type "Callable[[], None]"; expected "Callable[[], ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]]"  [arg-type]
+ colour/appearance/llab.py:212: error: Incompatible return value type (got "None", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]")  [return-value]
+ colour/appearance/llab.py:213: error: Argument "default_factory" to "field" has incompatible type "Callable[[], None]"; expected "Callable[[], ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]]"  [arg-type]
+ colour/appearance/llab.py:213: error: Incompatible return value type (got "None", expected "ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]")  [return-value]
+ colour/appearance/llab.py:255: error: Argument "default_factory" to "field" has incompatible type "Callable[[], None]"; expected "Callable[[], ndarray[tuple[Any, ...], dtype[floating[_16Bit] | floating[_32Bit] | float64]]]"  [arg-type]

... (truncated 316 lines) ...

anyio (https://github.com/agronholm/anyio)
+ src/anyio/from_thread.py:464: error: No overload variant of "field" matches argument types "bool", "None"  [call-overload]
+ src/anyio/from_thread.py:464: note: Possible overload variant:
+ src/anyio/from_thread.py:464: note:     def field(*, default: AbstractContextManager[BlockingPortal, bool | None], default_factory: Literal[_MISSING_TYPE.MISSING] = ..., init: bool = ..., repr: bool = ..., hash: bool | None = ..., compare: bool = ..., metadata: Mapping[Any, Any] | None = ..., kw_only: bool | Literal[_MISSING_TYPE.MISSING] = ..., doc: str | None = ...) -> AbstractContextManager[BlockingPortal, bool | None]

zulip (https://github.com/zulip/zulip)
+ zerver/actions/streams.py:779: error: No overload variant of "get" of "Mapping" matches argument types "Any", "None"  [call-overload]
+ zerver/actions/streams.py:779: note: Possible overload variant:
+ zerver/actions/streams.py:779: note:     def get(self, str, str, /) -> str
+ zerver/webhooks/taiga/view.py:170: error: Argument 1 to "tame" of "WildValue" has incompatible type "Callable[[str, object], str]"; expected "Callable[[str, object], dict[str, str | bool | None]]"  [arg-type]
+ zerver/webhooks/taiga/view.py:185: error: Argument 1 to "tame" of "WildValue" has incompatible type "Callable[[str, object], str]"; expected "Callable[[str, object], dict[str, str | bool | None]]"  [arg-type]
+ zerver/webhooks/taiga/view.py:186: error: Argument 1 to "tame" of "WildValue" has incompatible type "Callable[[str, object], str]"; expected "Callable[[str, object], dict[str, str | bool | None]]"  [arg-type]
+ zerver/webhooks/taiga/view.py:196: error: Argument 1 to "tame" of "WildValue" has incompatible type "Callable[[str, object], str]"; expected "Callable[[str, object], dict[str, str | bool | None]]"  [arg-type]
+ zerver/webhooks/taiga/view.py:197: error: Argument 1 to "tame" of "WildValue" has incompatible type "Callable[[str, object], str]"; expected "Callable[[str, object], dict[str, str | bool | None]]"  [arg-type]
+ zerver/webhooks/taiga/view.py:283: error: Argument 1 to "tame" of "WildValue" has incompatible type "Callable[[str, object], str]"; expected "Callable[[str, object], dict[str, str | bool | None]]"  [arg-type]

core (https://github.com/home-assistant/core)
+ homeassistant/setup.py:176: error: No overload variant of "pop" of "dict" matches argument types "str", "None"  [call-overload]
+ homeassistant/setup.py:176: note: Possible overload variant:
+ homeassistant/setup.py:176: note:     def pop(self, str, Future[bool], /) -> Future[bool]
+ homeassistant/components/media_player/browse_media.py:193: error: No overload variant of "field" matches argument type "None"  [call-overload]
+ homeassistant/components/media_player/browse_media.py:193: note: Possible overload variant:
+ homeassistant/components/media_player/browse_media.py:193: note:     def field(*, default: list[MediaClass], default_factory: Literal[_MISSING_TYPE.MISSING] = ..., init: bool = ..., repr: bool = ..., hash: bool | None = ..., compare: bool = ..., metadata: Mapping[Any, Any] | None = ..., kw_only: bool | Literal[_MISSING_TYPE.MISSING] = ...) -> list[MediaClass]
+ homeassistant/helpers/script.py:658: error: Argument 1 to "copy" has incompatible type "list[str] | None"; expected "list[str]"  [arg-type]
- homeassistant/components/todo/__init__.py:251: error: Returning Any from function declared to return "int | None"  [no-any-return]
+ homeassistant/components/conversation/chat_log.py:223: error: No overload variant of "field" matches argument type "None"  [call-overload]
+ homeassistant/components/conversation/chat_log.py:223: note: Possible overload variant:
+ homeassistant/components/conversation/chat_log.py:223: note:     def field(*, default: list[Attachment], default_factory: Literal[_MISSING_TYPE.MISSING] = ..., init: bool = ..., repr: bool = ..., hash: bool | None = ..., compare: bool = ..., metadata: Mapping[Any, Any] | None = ..., kw_only: bool | Literal[_MISSING_TYPE.MISSING] = ...) -> list[Attachment]
+ homeassistant/components/emulated_hue/config.py:167: error: Unused "type: ignore" comment  [unused-ignore]
+ homeassistant/components/emulated_hue/config.py:167: error: No overload variant of "Store" matches argument types "HomeAssistant", "str", "str"  [call-overload]
+ homeassistant/components/emulated_hue/config.py:167: note: Error code "call-overload" not covered by "type: ignore" comment
+ homeassistant/components/emulated_hue/config.py:167: note: Possible overload variant:
+ homeassistant/components/emulated_hue/config.py:167: note:     def __init__(self, hass: HomeAssistant, version: int, key: str, private: bool = ..., *, atomic_writes: bool = ..., encoder: type[JSONEncoder] | None = ..., minor_version: int = ..., read_only: bool = ..., serialize_in_event_loop: bool = ...) -> Store[Any]
+ homeassistant/components/verisure/coordinator.py:100: error: No overload variant of "next" matches argument types "Generator[Any, None, None]", "None"  [call-overload]
+ homeassistant/components/verisure/coordinator.py:100: note: Possible overload variants:
+ homeassistant/components/verisure/coordinator.py:100: note:     def next(SupportsNext[dict[Any, Any]], dict[Any, Any], /) -> dict[Any, Any]
+ homeassistant/components/verisure/coordinator.py:100: note:     def next(SupportsNext[list[Any]], list[Any], /) -> list[Any]
+ homeassistant/components/zwave_js/helpers.py:252: error: No overload variant of "next" matches argument types "Generator[ConfigEntry[Any], None, None]", "None"  [call-overload]
+ homeassistant/components/zwave_js/helpers.py:252: note: Possible overload variant:
+ homeassistant/components/zwave_js/helpers.py:252: note:     def next(SupportsNext[ConfigEntry[ZwaveJSData]], ConfigEntry[ZwaveJSData], /) -> ConfigEntry[ZwaveJSData]
+ homeassistant/components/zwave_js/helpers.py:300: error: No overload variant of "next" matches argument types "Generator[ConfigEntry[Any], None, None]", "None"  [call-overload]
+ homeassistant/components/zwave_js/helpers.py:300: note: Possible overload variant:
+ homeassistant/components/zwave_js/helpers.py:300: note:     def next(SupportsNext[ConfigEntry[ZwaveJSData]], ConfigEntry[ZwaveJSData], /) -> ConfigEntry[ZwaveJSData]
+ homeassistant/components/rachio/calendar.py:111: error: No overload variant of "next" matches argument types "Iterator[dict[str, Any]]", "None"  [call-overload]
+ homeassistant/components/rachio/calendar.py:111: note: Possible overload variant:
+ homeassistant/components/rachio/calendar.py:111: note:     def next(SupportsNext[dict[str, Any]], dict[str, Any], /) -> dict[str, Any]
+ homeassistant/components/zwave_js/config_flow.py:505: error: No overload variant of "next" matches argument types "Generator[ConfigEntry[Any], None, None]", "None"  [call-overload]
+ homeassistant/components/zwave_js/config_flow.py:505: note: Possible overload variant:
+ homeassistant/components/zwave_js/config_flow.py:505: note:     def next(SupportsNext[ConfigEntry[ZwaveJSData]], ConfigEntry[ZwaveJSData], /) -> ConfigEntry[ZwaveJSData]
+ homeassistant/components/zwave_js/config_flow.py:1529: error: No overload variant of "next" matches argument types "Generator[ConfigEntry[Any], None, None]", "None"  [call-overload]
+ homeassistant/components/zwave_js/config_flow.py:1529: note: Possible overload variant:
+ homeassistant/components/zwave_js/config_flow.py:1529: note:     def next(SupportsNext[ConfigEntry[Any]], ConfigEntry[Any], /) -> ConfigEntry[Any]
+ homeassistant/components/smartthings/fan.py:223: error: Argument 1 to "percentage_to_ordered_list_item" has incompatible type "list[int]"; expected "list[list[Any]]"  [arg-type]
+ homeassistant/components/mqtt/diagnostics.py:111: error: Argument 1 to "async_redact_data" has incompatible type "datetime | Collection[Any]"; expected "Collection[Any]"  [arg-type]
+ homeassistant/components/mqtt/config_flow.py:3769: error: Argument 1 to "deepcopy" has incompatible type "dict[str, Any] | None"; expected "dict[str, Any]"  [arg-type]
+ homeassistant/components/tado/climate.py:796: error: No overload variant of "get" of "dict" matches argument types "str", "dict[Never, Never]"  [call-overload]
+ homeassistant/components/tado/climate.py:796: note: Possible overload variant:
+ homeassistant/components/tado/climate.py:796: note:     def get(self, str, str, /) -> str
+ homeassistant/components/tado/climate.py:807: error: No overload variant of "get" of "dict" matches argument types "str", "dict[Never, Never]"  [call-overload]
+ homeassistant/components/tado/climate.py:807: note: Possible overload variant:
+ homeassistant/components/tado/climate.py:807: note:     def get(self, str, str, /) -> str
+ homeassistant/components/zha/helpers.py:1042: error: No overload variant of "field" matches argument type "None"  [call-overload]
+ homeassistant/components/zha/helpers.py:1042: note: Possible overload variant:
+ homeassistant/components/zha/helpers.py:1042: note:     def field(*, default: ConfigEntry[Any], default_factory: Literal[_MISSING_TYPE.MISSING] = ..., init: bool = ..., repr: bool = ..., hash: bool | None = ..., compare: bool = ..., metadata: Mapping[Any, Any] | None = ..., kw_only: bool | Literal[_MISSING_TYPE.MISSING] = ...) -> ConfigEntry[Any]

schemathesis (https://github.com/schemathesis/schemathesis)
+ src/schemathesis/generation/coverage.py: note: In member "generate_from_schema" of class "CoverageContext":
+ src/schemathesis/generation/coverage.py:300: error: Argument 1 to "deepclone" has incompatible type "dict[Any, Any] | bool"; expected "dict[Any, Any]"  [arg-type]

Tanjun (https://github.com/FasterSpeeding/Tanjun)
+ tanjun/_internal/localisation.py:88: error: No overload variant of "pop" of "dict" matches argument types "str", "None"  [call-overload]
+ tanjun/_internal/localisation.py:88: note: Possible overload variant:
+ tanjun/_internal/localisation.py:88: note:     def pop(self, str, str, /) -> str
+ tanjun/commands/slash.py:3136: error: No overload variant of "resolve_to_member" of "SlashOption" matches argument type "None"  [call-overload]
+ tanjun/commands/slash.py:3136: note: Possible overload variant:
+ tanjun/commands/slash.py:3136: note:     def resolve_to_member(self, *, default: InteractionMember) -> InteractionMember
+ tanjun/clients.py:2428: error: No overload variant of "get_type_dependency" of "Client" matches argument types "type[SingleStoreCache[AuthorizationApplication]]", "None"  [call-overload]
+ tanjun/clients.py:2428: note: Possible overload variant:
+ tanjun/clients.py:2428: note:     def get_type_dependency(self, type[SingleStoreCache[Application]], /, *, default: SingleStoreCache[Application]) -> SingleStoreCache[Application]

altair (https://github.com/vega/altair)
+ altair/datasets/_cache.py:309: error: No overload variant of "get" of "_Environ" matches argument types "str", "Path"  [call-overload]
+ altair/datasets/_cache.py:309: note: Possible overload variant:
+ altair/datasets/_cache.py:309: note:     def get(self, key: str, default: str) -> str
+ altair/vegalite/v6/api.py:3671: error: No overload variant of "pop" of "dict" matches argument types "str", "UndefinedType"  [call-overload]
+ altair/vegalite/v6/api.py:3671: note: Possible overload variant:
+ altair/vegalite/v6/api.py:3671: note:     def pop(self, str, str, /) -> str
+ tests/vegalite/v6/schema/test_channels.py:56: error: Unused "type: ignore" comment  [unused-ignore]
+ tests/vegalite/v6/schema/test_channels.py:56: error: No overload variant of <list> matches argument types "list[int]", "tuple[date, ...]"  [call-overload]
+ tests/vegalite/v6/schema/test_channels.py:56: note: Error code "call-overload" not covered by "type: ignore" comment
+ tests/vegalite/v6/schema/test_channels.py:56: note: Possible overload variants:
+ tests/vegalite/v6/schema/test_channels.py:56: note:     def <list>(*str) -> list[str]
+ tests/vegalite/v6/schema/test_channels.py:56: note:     def <list>(*bool) -> list[bool]
+ tests/vegalite/v6/schema/test_channels.py:56: note:     def <list>(*float) -> list[float]
+ tests/vegalite/v6/schema/test_channels.py:56: note:     def <list>(*DateTime | date) -> list[DateTime | date]

nionutils (https://github.com/nion-software/nionutils)
+ nion/utils/StructuredModel.py:195: error: Argument 1 to "deepcopy" has incompatible type "str | dict[str, Any]"; expected "dict[str, Any]"  [arg-type]
+ nion/utils/StructuredModel.py:300: error: Argument 1 to "deepcopy" has incompatible type "str | dict[str, Any]"; expected "dict[str, Any]"  [arg-type]

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/theming.py: note: In function "_convert_theme_conf":
+ sphinx/theming.py:438:42: error: No overload variant of "get" of "RawConfigParser" matches argument types "str", "str", "None"  [call-overload]
+ sphinx/theming.py:438:42: note: Possible overload variant:
+ sphinx/theming.py:438:42: note:     def get(self, section: str, option: str, *, raw: bool = ..., vars: Mapping[str, str] | None = ..., fallback: str) -> str | Any
+ sphinx/theming.py:441:39: error: No overload variant of "get" of "RawConfigParser" matches argument types "str", "str", "None"  [call-overload]
+ sphinx/theming.py:441:39: note: Possible overload variant:
+ sphinx/theming.py:441:39: note:     def get(self, section: str, option: str, *, raw: bool = ..., vars: Mapping[str, str] | None = ..., fallback: str) -> str | Any

pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/mark/structures.py:257: error: No overload variant of "field" matches argument types "None", "bool"  [call-overload]
+ src/_pytest/mark/structures.py:257: note: Possible overload variant:
+ src/_pytest/mark/structures.py:257: note:     def field(*, default: Sequence[str], default_factory: Literal[_MISSING_TYPE.MISSING] = ..., init: bool = ..., repr: bool = ..., hash: bool | None = ..., compare: bool = ..., metadata: Mapping[Any, Any] | None = ..., kw_only: bool | Literal[_MISSING_TYPE.MISSING] = ...) -> Sequence[str]

steam.py (https://github.com/Gobot1234/steam.py)
- steam/id.py:462: error: Argument "instance" to "ID" has incompatible type "int"; expected "Instance | None"  [arg-type]
+ steam/id.py:462: error: No overload variant of "ID" matches argument types "int", "int", "Universe", "int"  [call-overload]
+ steam/id.py:462: note: Possible overload variant:
+ steam/id.py:462: note:     def __init__(self, id: SupportsInt | SupportsIndex | str | bytes, *, type: Any | None = ..., universe: Universe | None = ..., instance: Instance | None = ...) -> ID[Any]
- steam/id.py:513: error: Argument "universe" to "ID" has incompatible type "int"; expected "Universe | None"  [arg-type]
- steam/id.py:513: error: Argument "instance" to "ID" has incompatible type "int"; expected "Instance | None"  [arg-type]
+ steam/id.py:513: error: No overload variant of "ID" matches argument types "ID32", "int", "int", "int"  [call-overload]
+ steam/id.py:513: note: Possible overload variant:
+ steam/id.py:513: note:     def __init__(self, id: SupportsInt | SupportsIndex | str | bytes, *, type: Any | None = ..., universe: Universe | None = ..., instance: Instance | None = ...) -> ID[Any]
+ steam/state.py:1392: error: Unused "type: ignore" comment  [unused-ignore]

sympy (https://github.com/sympy/sympy)
+ sympy/matrices/matrixbase.py:1590: error: Unused "type: ignore" comment  [unused-ignore]
+ sympy/matrices/matrixbase.py:5274: error: List comprehension has incompatible type List[int]; expected List[Expr | Literal[0]]  [misc]
+ sympy/matrices/matrixbase.py:5274: error: Argument 1 to "sum" has incompatible type "list[Expr]"; expected "Iterable[bool]"  [arg-type]
+ sympy/matrices/matrixbase.py:5286: error: List comprehension has incompatible type List[int]; expected List[Expr | Literal[0]]  [misc]
+ sympy/matrices/matrixbase.py:5286: error: Argument 1 to "sum" has incompatible type "list[Expr]"; expected "Iterable[bool]"  [arg-type]

urllib3 (https://github.com/urllib3/urllib3)
+ test/test_util.py:534: error: Unused "type: ignore" comment  [unused-ignore]
+ test/test_util.py:534: error: No overload variant of <list> matches argument types "Callable[[_TestFuncT], _TestFuncT]", "Callable[[_TestFuncT], _TestFuncT]"  [call-overload]
+ test/test_util.py:534: note: Error code "call-overload" not covered by "type: ignore" comment
+ test/test_util.py:534: note: Possible overload variant:
+ test/test_util.py:534: note:     def <list>(*MarkDecorator | Mark) -> list[MarkDecorator | Mark]
+ test/test_util.py:539: error: Unused "type: ignore" comment  [unused-ignore]
+ test/test_util.py:539: error: No overload variant of <list> matches argument types "Callable[[_TestFuncT], _TestFuncT]", "Callable[[_TestFuncT], _TestFuncT]"  [call-overload]
+ test/test_util.py:539: note: Error code "call-overload" not covered by "type: ignore" comment
+ test/test_util.py:539: note: Possible overload variant:
+ test/test_util.py:539: note:     def <list>(*MarkDecorator | Mark) -> list[MarkDecorator | Mark]
+ test/test_util.py:544: error: Unused "type: ignore" comment  [unused-ignore]
+ test/test_util.py:544: error: No overload variant of <list> matches argument types "Callable[[_TestFuncT], _TestFuncT]", "Callable[[_TestFuncT], _TestFuncT]"  [call-overload]
+ test/test_util.py:544: note: Error code "call-overload" not covered by "type: ignore" comment
+ test/test_util.py:544: note: Possible overload variant:
+ test/test_util.py:544: note:     def <list>(*MarkDecorator | Mark) -> list[MarkDecorator | Mark]
+ test/test_util.py:549: error: Unused "type: ignore" comment  [unused-ignore]
+ test/test_util.py:549: error: No overload variant of <list> matches argument types "Callable[[_TestFuncT], _TestFuncT]", "Callable[[_TestFuncT], _TestFuncT]"  [call-overload]
+ test/test_util.py:549: note: Error code "call-overload" not covered by "type: ignore" comment
+ test/test_util.py:549: note: Possible overload variant:
+ test/test_util.py:549: note:     def <list>(*MarkDecorator | Mark) -> list[MarkDecorator | Mark]
+ test/test_util.py:556: error: Unused "type: ignore" comment  [unused-ignore]

... (truncated 458 lines) ...```

@hauntsaninja
Copy link
Collaborator

hauntsaninja commented Jan 5, 2026

What is the issue this PR is attempting to fix? Could you add a test?

@kumar-ayan
Copy link
Author

What is the issue this PR is attempting to fix? Could you add a test?

Issue: False positive when assigning bounded generic to union including the bound

Test case:

def upcast(arg: int) -> int:
    return arg

def test[X: int](items: list[X]) -> list[X]:
    _a: list[int] = list(items)           # ✅️
    _b: list[int] = [*items]              # ✅️
    _c: list[int] = [x for x in items]    # ✅️

    _1: list[str] | list[int] = list(items)         # ❌️
    _2: list[int] | list[str] = list(items)         # ❌️
    _3: list[str] | list[int] = [*items]            # ❌️
    _4: list[int] | list[str] = [*items]            # ❌️
    _5: list[str] | list[int] = [x for x in items]  # ❌️
    _6: list[int] | list[str] = [x for x in items]  # ❌️
    _7: list[str] | list[int] = [upcast(x) for x in items]  # ✅️
    _8: list[int] | list[str] = [upcast(x) for x in items]  # ✅️
    return items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants