-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed an inconsistency in how a constructor (an __init__
method) is…
#6142
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… converted to a callable for a generic class. This addresses #6139.
Diff from mypy_primer, showing the effect of this PR on open source code: spack (https://github.com/spack/spack)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/audit.py:113:35 - error: Argument of type "Unknown" cannot be assigned to parameter "__object" of type "_T@list" in function "append"
+ Type "Unknown" cannot be assigned to type "_T@list" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/audit.py:239:28 - error: Cannot access member "_start_mark" for type "object*"
+ Member "_start_mark" is unknown (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/audit.py:355:47 - error: Argument of type "tuple[type, Any]" cannot be assigned to parameter "__object" of type "_T@list" in function "append"
+ Type "tuple[type, Any]" cannot be assigned to type "_T@list" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/audit.py:366:42 - error: "__getitem__" method not defined on type "object*" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/config.py:407:53 - error: Cannot assign member "format_updates" for type "Configuration"
+ "defaultdict[Unknown, list[_T@list]]" is incompatible with "Dict[str, List[str]]"
+ Type parameter "_VT@dict" is invariant, but "list[_T@list]" is not the same as "List[str]"
+ Consider switching from "dict" to "Mapping" which is covariant in the value type (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/installer.py:1946:49 - error: Expression of type "defaultdict[Unknown, set[_T@set]]" cannot be assigned to declared type "Dict[str, Set[str]]"
+ "defaultdict[Unknown, set[_T@set]]" is incompatible with "Dict[str, Set[str]]"
+ Type parameter "_VT@dict" is invariant, but "set[_T@set]" is not the same as "Set[str]"
+ Consider switching from "dict" to "Mapping" which is covariant in the value type (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/spec.py:3122:34 - error: Argument of type "tuple[Unknown, Unknown] | Unknown" cannot be assigned to parameter "__object" of type "_T@list" in function "append"
+ Type "tuple[Unknown, Unknown] | Unknown" cannot be assigned to type "_T@list" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/spec.py:4539:29 - error: Cannot access member "spec" for type "object*"
+ Member "spec" is unknown (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/spec.py:4570:40 - error: Cannot access member "depflag" for type "object*"
+ Member "depflag" is unknown (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/traverse.py:338:33 - error: Argument of type "Unknown | tuple[Unknown, Unknown]" cannot be assigned to parameter "__object" of type "_T@list" in function "append"
+ Type "Unknown | tuple[Unknown, Unknown]" cannot be assigned to type "_T@list" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/traverse.py:352:33 - error: Argument of type "Unknown | tuple[Unknown, Unknown]" cannot be assigned to parameter "__object" of type "_T@list" in function "append"
+ Type "Unknown | tuple[Unknown, Unknown]" cannot be assigned to type "_T@list" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/cmd/__init__.py:459:47 - error: Cannot access member "spec" for type "object*"
+ Member "spec" is unknown (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/cmd/__init__.py:459:65 - error: Cannot access member "spec" for type "object*"
+ Member "spec" is unknown (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/cmd/arch.py:70:29 - error: Cannot access member "family" for type "object*"
+ Member "family" is unknown (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/cmd/arch.py:76:55 - error: Cannot access member "ancestors" for type "object*"
+ Member "ancestors" is unknown (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/cmd/unit_test.py:162:28 - error: Argument of type "tuple[Unknown, ...]" cannot be assigned to parameter "__element" of type "_T@set" in function "add"
+ Type "tuple[Unknown, ...]" cannot be assigned to type "_T@set" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/cmd/unit_test.py:176:59 - error: Argument of type "set[_T@set]" cannot be assigned to parameter "__iterable" of type "Iterable[SupportsRichComparisonT@sorted]" in function "sorted"
+ "set[_T@set]" is incompatible with "Iterable[SupportsRichComparisonT@sorted]"
+ Type parameter "_T_co@Iterable" is covariant, but "_T@set" is not a subtype of "SupportsRichComparisonT@sorted"
+ Type "_T@set" cannot be assigned to type "SupportsRichComparison"
+ Type "_T@set" cannot be assigned to type "SupportsRichComparison"
+ "object*" is incompatible with protocol "SupportsDunderLT[Any]"
+ "object*" is incompatible with protocol "SupportsDunderGT[Any]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/cmd/unit_test.py:185:29 - error: Argument of type "set[_T@set]" cannot be assigned to parameter "__iterable" of type "Iterable[SupportsRichComparisonT@sorted]" in function "sorted"
+ "set[_T@set]" is incompatible with "Iterable[SupportsRichComparisonT@sorted]"
+ Type parameter "_T_co@Iterable" is covariant, but "_T@set" is not a subtype of "SupportsRichComparisonT@sorted"
+ Type "_T@set" cannot be assigned to type "SupportsRichComparison"
+ Type "_T@set" cannot be assigned to type "SupportsRichComparison"
+ "object*" is incompatible with protocol "SupportsDunderLT[Any]"
+ "object*" is incompatible with protocol "SupportsDunderGT[Any]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/cmd/modules/__init__.py:330:55 - error: Cannot access member "spec" for type "object*"
+ Member "spec" is unknown (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/detection/path.py:121:40 - error: Argument of type "str" cannot be assigned to parameter "__element" of type "_T@set" in function "add"
+ Type "str" cannot be assigned to type "_T@set" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/detection/path.py:122:12 - error: Expression of type "defaultdict[Unknown, set[_T@set]]" cannot be assigned to return type "Dict[str, Set[str]]"
+ "defaultdict[Unknown, set[_T@set]]" is incompatible with "Dict[str, Set[str]]"
+ Type parameter "_VT@dict" is invariant, but "set[_T@set]" is not the same as "Set[str]"
+ Consider switching from "dict" to "Mapping" which is covariant in the value type (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/detection/path.py:367:12 - error: Expression of type "defaultdict[Unknown, list[_T@list]]" cannot be assigned to return type "Dict[str, List[DetectedPackage]]"
+ "defaultdict[Unknown, list[_T@list]]" is incompatible with "Dict[str, List[DetectedPackage]]"
+ Type parameter "_VT@dict" is invariant, but "list[_T@list]" is not the same as "List[DetectedPackage]"
+ Consider switching from "dict" to "Mapping" which is covariant in the value type (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/modules/lmod.py:361:35 - error: Argument of type "tuple[str, ...]" cannot be assigned to parameter "__object" of type "_T@list" in function "append"
+ Type "tuple[str, ...]" cannot be assigned to type "_T@list" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/modules/lmod.py:387:36 - error: Argument of type "tuple[str, ...]" cannot be assigned to parameter "__object" of type "_T@list" in function "append"
+ Type "tuple[str, ...]" cannot be assigned to type "_T@list" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/modules/lmod.py:459:63 - error: "object*" is not iterable
+ "__iter__" method not defined (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/solver/asp.py:1038:73 - error: Cannot access member "version" for type "object*"
+ Member "version" is unknown (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/solver/asp.py:1053:25 - error: Argument of type "set[_T@set]" cannot be assigned to parameter "__iterable" of type "Iterable[SupportsRichComparisonT@sorted]" in function "sorted"
+ "set[_T@set]" is incompatible with "Iterable[SupportsRichComparisonT@sorted]"
+ Type parameter "_T_co@Iterable" is covariant, but "_T@set" is not a subtype of "SupportsRichComparisonT@sorted"
+ Type "_T@set" cannot be assigned to type "SupportsRichComparison"
+ Type "_T@set" cannot be assigned to type "SupportsRichComparison"
+ "object*" is incompatible with protocol "SupportsDunderLT[Any]"
+ "object*" is incompatible with protocol "SupportsDunderGT[Any]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/solver/asp.py:1280:17 - error: "object*" is not iterable
+ "__iter__" method not defined (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/solver/asp.py:1293:17 - error: "object*" is not iterable
+ "__iter__" method not defined (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/solver/asp.py:1425:13 - error: Argument of type "str" cannot be assigned to parameter "__key" of type "_KT@dict" in function "__setitem__"
+ Type "str" cannot be assigned to type "_KT@dict" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/spack/lib/spack/spack/solver/asp.py:1425:13 - error: Argument of type "tuple[int, Unknown]" cannot be assigned to parameter "__value" of type "_VT@dict" in function "__setitem__"
+ Type "tuple[int, Unknown]" cannot be assigned to type "_VT@dict" (reportGeneralTypeIssues)
... (truncated 57 lines) ...
alectryon (https://github.com/cpitclaudel/alectryon)
+ /tmp/mypy_primer/projects/alectryon/alectryon/docutils.py:222:57 - error: Cannot assign member "driver_args" for type "Config"
+ "defaultdict[Unknown, list[_T@list]]" is incompatible with "DefaultDict[str, List[str]]"
+ Type parameter "_VT@defaultdict" is invariant, but "list[_T@list]" is not the same as "List[str]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/alectryon/alectryon/docutils.py:224:13 - error: Argument of type "list[str]" cannot be assigned to parameter "__value" of type "list[_T@list]" in function "__setitem__"
+ "list[str]" is incompatible with "list[_T@list]"
+ Type parameter "_T@list" is invariant, but "str" is not the same as "_T@list"
+ Consider switching from "list" to "Sequence" which is covariant (reportGeneralTypeIssues)
- 15 errors, 37 warnings, 0 informations
+ 17 errors, 37 warnings, 0 informations
pydantic (https://github.com/samuelcolvin/pydantic)
+ /tmp/mypy_primer/projects/pydantic/pydantic/json_schema.py:165:78 - error: Expression of type "defaultdict[Unknown, list[_T@list]]" cannot be assigned to declared type "dict[DefsRef, list[JsonSchemaValue]]"
+ "defaultdict[Unknown, list[_T@list]]" is incompatible with "dict[DefsRef, list[JsonSchemaValue]]"
+ Type parameter "_VT@dict" is invariant, but "list[_T@list]" is not the same as "list[JsonSchemaValue]"
+ Consider switching from "dict" to "Mapping" which is covariant in the value type (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/pydantic/pydantic/_internal/_known_annotated_metadata.py:56:55 - error: Expression of type "defaultdict[Unknown, set[_T@set]]" cannot be assigned to declared type "dict[str, set[str]]"
+ "defaultdict[Unknown, set[_T@set]]" is incompatible with "dict[str, set[str]]"
+ Type parameter "_VT@dict" is invariant, but "set[_T@set]" is not the same as "set[str]"
+ Consider switching from "dict" to "Mapping" which is covariant in the value type (reportGeneralTypeIssues)
- 53 errors, 0 warnings, 0 informations
+ 55 errors, 0 warnings, 0 informations
mkosi (https://github.com/systemd/mkosi)
+ /tmp/mypy_primer/projects/mkosi/mkosi/manifest.py
+ /tmp/mypy_primer/projects/mkosi/mkosi/manifest.py:44:73 - error: Argument of type "type[list[_T@list]]" cannot be assigned to parameter "default_factory" of type "() -> _T@field" in function "field"
+ No overloaded function matches type "() -> list[PackageManifest]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/mkosi/mkosi/manifest.py:84:73 - error: Argument of type "type[list[_T@list]]" cannot be assigned to parameter "default_factory" of type "() -> _T@field" in function "field"
+ No overloaded function matches type "() -> list[PackageManifest]" (reportGeneralTypeIssues)
- 4 errors, 0 warnings, 0 informations
+ 6 errors, 0 warnings, 0 informations
freqtrade (https://github.com/freqtrade/freqtrade)
+ /tmp/mypy_primer/projects/freqtrade/freqtrade/commands/data_commands.py:119:53 - error: Argument of type "str" cannot be assigned to parameter "__object" of type "_T@list" in function "append"
+ Type "str" cannot be assigned to type "_T@list" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/freqtrade/freqtrade/commands/data_commands.py:123:24 - error: No overloads for "join" match the provided arguments (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/freqtrade/freqtrade/commands/data_commands.py:123:34 - error: Argument of type "list[_T@list]" cannot be assigned to parameter "__iterable" of type "Iterable[str]" in function "join"
+ "list[_T@list]" is incompatible with "Iterable[str]"
+ Type parameter "_T_co@Iterable" is covariant, but "_T@list" is not a subtype of "str"
+ "object*" is incompatible with "str" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/freqtrade/freqtrade/edge/edge_positioning.py:124:39 - error: Argument of type "str" cannot be assigned to parameter "__object" of type "_T@list" in function "append"
+ Type "str" cannot be assigned to type "_T@list" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/freqtrade/freqtrade/edge/edge_positioning.py:131:27 - error: Argument of type "list[_T@list]" cannot be assigned to parameter "pairs" of type "List[str]" in function "refresh_data"
+ "list[_T@list]" is incompatible with "List[str]"
+ Type parameter "_T@list" is invariant, but "_T@list" is not the same as "str"
+ Consider switching from "list" to "Sequence" which is covariant (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/freqtrade/freqtrade/persistence/trade_model.py:323:56 - error: Expression of type "defaultdict[Unknown, list[_T@list]]" cannot be assigned to declared type "Dict[str, List[LocalTrade]]"
+ "defaultdict[Unknown, list[_T@list]]" is incompatible with "Dict[str, List[LocalTrade]]"
+ Type parameter "_VT@dict" is invariant, but "list[_T@list]" is not the same as "List[LocalTrade]"
+ Consider switching from "dict" to "Mapping" which is covariant in the value type (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/freqtrade/freqtrade/persistence/trade_model.py:641:40 - error: Cannot assign member "bt_trades_open_pp" for type "type[LocalTrade]"
+ "defaultdict[Unknown, list[_T@list]]" is incompatible with "Dict[str, List[LocalTrade]]"
+ Type parameter "_VT@dict" is invariant, but "list[_T@list]" is not the same as "List[LocalTrade]"
+ Consider switching from "dict" to "Mapping" which is covariant in the value type (reportGeneralTypeIssues)
- 555 errors, 38 warnings, 0 informations
+ 562 errors, 38 warnings, 0 informations
steam.py (https://github.com/Gobot1234/steam.py)
+ /tmp/mypy_primer/projects/steam.py/steam/manifest.py:710:49 - error: Argument of type "type[list[_T@list]]" cannot be assigned to parameter "default_factory" of type "() -> _T@field" in function "field"
+ No overloaded function matches type "() -> list[Depot]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/steam.py/steam/ext/commands/converters.py:78:50 - error: Argument of type "type[list[_T@list]]" cannot be assigned to parameter "__default_factory" of type "(() -> list[Converters]) | None" in function "__init__"
+ Type "type[list[_T@list]]" cannot be assigned to type "(() -> list[Converters]) | None"
+ No overloaded function matches type "() -> list[Converters]"
+ Type cannot be assigned to type "None" (reportGeneralTypeIssues)
- 7933 errors, 22 warnings, 0 informations
+ 7935 errors, 22 warnings, 0 informations
Tanjun (https://github.com/FasterSpeeding/Tanjun)
+ /tmp/mypy_primer/projects/Tanjun/tanjun/dependencies/reloaders.py:554:81 - error: Argument of type "type[list[_T@list]]" cannot be assigned to parameter "default_factory" of type "() -> _T@field" in function "field"
+ No overloaded function matches type "() -> list[str]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/Tanjun/tanjun/dependencies/reloaders.py:555:91 - error: Argument of type "type[list[_T@list]]" cannot be assigned to parameter "default_factory" of type "() -> _T@field" in function "field"
+ No overloaded function matches type "() -> list[Path]" (reportGeneralTypeIssues)
- 2344 errors, 9813 warnings, 0 informations
+ 2346 errors, 9813 warnings, 0 informations
pyp (https://github.com/hauntsaninja/pyp)
+ /tmp/mypy_primer/projects/pyp/pyp.py:252:51 - error: Cannot assign member "def_to_names" for type "PypConfig"
+ "defaultdict[Unknown, list[_T@list]]" is incompatible with "Dict[int, List[str]]"
+ Type parameter "_VT@dict" is invariant, but "list[_T@list]" is not the same as "List[str]"
+ Consider switching from "dict" to "Mapping" which is covariant in the value type (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/pyp/pyp.py:254:46 - error: Cannot assign member "requires" for type "PypConfig"
+ "defaultdict[Unknown, set[_T@set]]" is incompatible with "Dict[int, Set[str]]"
+ Type parameter "_VT@dict" is invariant, but "set[_T@set]" is not the same as "Set[str]"
+ Consider switching from "dict" to "Mapping" which is covariant in the value type (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/pyp/pyp.py:282:49 - error: Argument of type "str" cannot be assigned to parameter "__object" of type "_T@list" in function "append"
+ Type "str" cannot be assigned to type "_T@list" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/pyp/pyp.py:283:13 - error: Argument of type "Set[str]" cannot be assigned to parameter "__value" of type "set[_T@set]" in function "__setitem__"
+ "Set[str]" is incompatible with "set[_T@set]"
+ Type parameter "_T@set" is invariant, but "str" is not the same as "_T@set" (reportGeneralTypeIssues)
- 6 errors, 0 warnings, 0 informations
+ 10 errors, 0 warnings, 0 informations
antidote (https://github.com/Finistere/antidote)
+ /tmp/mypy_primer/projects/antidote/src/antidote/core/_debug.py:66:59 - error: Argument of type "type[list[_T@list]]" cannot be assigned to parameter "default_factory" of type "() -> _T@field" in function "field"
+ No overloaded function matches type "() -> List[DebugTreeNode]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/antidote/src/antidote/core/_raw/onion.py:42:66 - error: Argument of type "type[list[_T@list]]" cannot be assigned to parameter "default_factory" of type "() -> _T@field" in function "field"
+ No overloaded function matches type "() -> list[() -> None]" (reportGeneralTypeIssues)
- 729 errors, 31 warnings, 0 informations
+ 731 errors, 31 warnings, 0 informations
dd-trace-py (https://github.com/DataDog/dd-trace-py)
+ /tmp/mypy_primer/projects/dd-trace-py/ddtrace/appsec/_processor.py:126:70 - error: Argument of type "type[set[_T@set]]" cannot be assigned to parameter "default_factory" of type "() -> _T@field" in function "field"
+ No overloaded function matches type "() -> Set[str]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/dd-trace-py/ddtrace/debugging/_debugger.py:447:31 - error: Expression of type "defaultdict[Unknown, list[_T@list]]" cannot be assigned to declared type "Dict[FullyNamedWrappedFunction, List[Probe]]"
+ "defaultdict[Unknown, list[_T@list]]" is incompatible with "Dict[FullyNamedWrappedFunction, List[Probe]]"
+ Type parameter "_VT@dict" is invariant, but "list[_T@list]" is not the same as "List[Probe]"
+ Consider switching from "dict" to "Mapping" which is covariant in the value type (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/dd-trace-py/ddtrace/debugging/_probe/registry.py
+ /tmp/mypy_primer/projects/dd-trace-py/ddtrace/debugging/_probe/registry.py:64:25 - error: Cannot assign member "_pending" for type "ProbeRegistry"
+ "defaultdict[Unknown, list[_T@list]]" is incompatible with "Dict[str, List[Probe]]"
+ Type parameter "_VT@dict" is invariant, but "list[_T@list]" is not the same as "List[Probe]"
+ Consider switching from "dict" to "Mapping" which is covariant in the value type (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/dd-trace-py/ddtrace/internal/core.py:145:46 - error: Argument of type "(...) -> Unknown" cannot be assigned to parameter "__object" of type "_T@list" in function "append"
+ Type "(...) -> Unknown" cannot be assigned to type "_T@list" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/dd-trace-py/ddtrace/internal/core.py:169:26 - error: Object of type "object*" is not callable (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/dd-trace-py/ddtrace/internal/module.py:241:26 - error: Cannot assign member "_hook_map" for type "ModuleWatchdog"
+ "defaultdict[Unknown, list[_T@list]]" is incompatible with "DefaultDict[str, List[ModuleHookType]]"
+ Type parameter "_VT@defaultdict" is invariant, but "list[_T@list]" is not the same as "List[ModuleHookType]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/dd-trace-py/ddtrace/internal/ci_visibility/recorder.py:91:22 - error: Expression of type "defaultdict[Unknown, list[_T@list]]" cannot be assigned to declared type "DefaultDict[str, List[str]]"
+ "defaultdict[Unknown, list[_T@list]]" is incompatible with "DefaultDict[str, List[str]]"
+ Type parameter "_VT@defaultdict" is invariant, but "list[_T@list]" is not the same as "List[str]" (reportGeneralTypeIssues)
- 9376 errors, 466 warnings, 0 informations
+ 9383 errors, 466 warnings, 0 informations
hydra-zen (https://github.com/mit-ll-responsible-ai/hydra-zen)
+ /tmp/mypy_primer/projects/hydra-zen/src/hydra_zen/wrapper/_implementations.py:1344:66 - error: Expression of type "defaultdict[Unknown, list[_T@list]]" cannot be assigned to declared type "DefaultDict[str | None, List[str]]"
+ "defaultdict[Unknown, list[_T@list]]" is incompatible with "DefaultDict[str | None, List[str]]"
+ Type parameter "_VT@defaultdict" is invariant, but "list[_T@list]" is not the same as "List[str]" (reportGeneralTypeIssues)
- 175 errors, 0 warnings, 0 informations
+ 176 errors, 0 warnings, 0 informations
discord.py (https://github.com/Rapptz/discord.py)
+ /tmp/mypy_primer/projects/discord.py/discord/ext/commands/flags.py
+ /tmp/mypy_primer/projects/discord.py/discord/ext/commands/flags.py:85:48 - error: Argument of type "type[list[_T@list]]" cannot be assigned to parameter "default_factory" of type "() -> _T@field" in function "field"
+ No overloaded function matches type "() -> List[str]" (reportGeneralTypeIssues)
- 48 errors, 14 warnings, 0 informations
+ 49 errors, 14 warnings, 0 informations
pandera (https://github.com/pandera-dev/pandera)
+ /tmp/mypy_primer/projects/pandera/pandera/api/pyspark/error_handler.py:90:17 - error: Argument of type "dict[str, Unknown | str | None]" cannot be assigned to parameter "__object" of type "_T@list" in function "append" (reportGeneralTypeIssues)
- 1111 errors, 10 warnings, 0 informations
+ 1112 errors, 10 warnings, 0 informations
mypy-protobuf (https://github.com/dropbox/mypy-protobuf)
+ /tmp/mypy_primer/projects/mypy-protobuf/mypy_protobuf/main.py:160:69 - error: Cannot assign member "from_imports" for type "PkgWriter"
+ "defaultdict[Unknown, set[_T@set]]" is incompatible with "Dict[str, Set[Tuple[str, str | None]]]"
+ Type parameter "_VT@dict" is invariant, but "set[_T@set]" is not the same as "Set[Tuple[str, str | None]]"
+ Consider switching from "dict" to "Mapping" which is covariant in the value type (reportGeneralTypeIssues)
- 17 errors, 24 warnings, 0 informations
+ 18 errors, 24 warnings, 0 informations
materialize (https://github.com/MaterializeInc/materialize)
+ /tmp/mypy_primer/projects/materialize/misc/python/materialize/mzbuild.py:835:52 - error: Argument of type "PreImage" cannot be assigned to parameter "__object" of type "_T@list" in function "append"
+ Type "PreImage" cannot be assigned to type "_T@list" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/materialize/misc/python/materialize/mzbuild.py:837:47 - error: Argument of type "list[_T@list]" cannot be assigned to parameter "instances" of type "list[PreImage]" in function "prepare_batch"
+ "list[_T@list]" is incompatible with "list[PreImage]"
+ Type parameter "_T@list" is invariant, but "_T@list" is not the same as "PreImage"
+ Consider switching from "list" to "Sequence" which is covariant (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/materialize/misc/python/materialize/cli/crate_diagram.py:73:42 - error: Expression of type "defaultdict[Unknown, list[_T@list]]" cannot be assigned to declared type "defaultdict[str, list[str]]"
+ "defaultdict[Unknown, list[_T@list]]" is incompatible with "defaultdict[str, list[str]]"
+ Type parameter "_VT@defaultdict" is invariant, but "list[_T@list]" is not the same as "list[str]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/materialize/misc/python/materialize/cli/crate_diagram.py:141:30 - error: Argument of type "defaultdict[Unknown, set[_T@set]]" cannot be assigned to parameter "new_deps" of type "defaultdict[str, set[str]]" in function "add_deps"
+ "defaultdict[Unknown, set[_T@set]]" is incompatible with "defaultdict[str, set[str]]"
+ Type parameter "_VT@defaultdict" is invariant, but "set[_T@set]" is not the same as "set[str]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/materialize/misc/python/materialize/cli/crate_diagram.py:144:27 - error: Expression of type "dict[Unknown, list[_T@set]]" cannot be assigned to declared type "DepMap" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/materialize/misc/python/materialize/cli/crate_diagram.py:155:40 - error: Argument of type "str" cannot be assigned to parameter "__object" of type "_T@list" in function "append"
+ Type "str" cannot be assigned to type "_T@list" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/materialize/misc/python/materialize/cli/crate_diagram.py:157:26 - error: Expression of type "tuple[DepMap, defaultdict[Unknown, list[_T@list]]]" cannot be assigned to return type "tuple[DepMap, DepBuilder]"
+ "defaultdict[Unknown, list[_T@list]]" is incompatible with "DepBuilder"
+ Type parameter "_VT@defaultdict" is invariant, but "list[_T@list]" is not the same as "list[str]" (reportGeneralTypeIssues)
- 12 errors, 235 warnings, 0 informations
+ 19 errors, 235 warnings, 0 informations
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
… converted to a callable for a generic class. This addresses #6139.