| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Looking at the primer, something is wrong with the class objects as r.h.s., I will check tomorrow. |
Sorry, something went wrong.
|
@JukkaL I think this is ready for review, I spot-checked most of the primer and the results look good. There are some minor changes in semantics caused by moving override check to a single location after the variable type was inferred. Looking back at this now, it is actually not strictly necessary, but IMO it removes the coupling between override checks and inference, and so makes things more predictable and easier to reason about. |
Sorry, something went wrong.
Sorry, something went wrong.
|
Diff from mypy_primer, showing the effect of this PR on open source code: comtypes (https://github.com/enthought/comtypes)
- comtypes/_post_coinit/unknwn.py:303: error: Incompatible types in assignment (expression has type "property", base class "_SimpleCData" defined the type as "int | None") [assignment]
manticore (https://github.com/trailofbits/manticore)
+ manticore/core/smtlib/solver.py:1050: error: Incompatible types in assignment (expression has type "SmtlibPortfolio", base class "SMTLIBSolver" defined the type as "SmtlibProc") [assignment]
static-frame (https://github.com/static-frame/static-frame)
+ static_frame/core/archive_npy.py:305: error: Incompatible types in assignment (expression has type "Callable[[DefaultNamedArg(int | None, 'dir_fd')], None]", base class "Archive" defined the type as "Callable[[str | PathLike[Any]], None]") [assignment]
pandas (https://github.com/pandas-dev/pandas)
+ pandas/io/common.py:995: error: No overload variant of "open" of "TarFile" matches argument types "str | None", "str", "ReadBuffer[bytes] | WriteBuffer[bytes] | None", "dict[str, Any]" [call-overload]
+ pandas/io/common.py:995: note: Error code "call-overload" not covered by "type: ignore" comment
+ pandas/io/common.py:995: note: Possible overload variants:
+ pandas/io/common.py:995: note: def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., mode: Literal['r', 'r:*', 'r:', 'r:gz', 'r:bz2', 'r:xz'] = ..., fileobj: _Fileobj | None = ..., bufsize: int = ..., *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note: def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | None, mode: Literal['x', 'x:', 'a', 'a:', 'w', 'w:', 'w:tar'], fileobj: _Fileobj | None = ..., bufsize: int = ..., *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note: def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., *, mode: Literal['x', 'x:', 'a', 'a:', 'w', 'w:', 'w:tar'], fileobj: _Fileobj | None = ..., bufsize: int = ..., format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note: def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | None, mode: Literal['x:gz', 'x:bz2', 'w:gz', 'w:bz2'], fileobj: _Fileobj | None = ..., bufsize: int = ..., *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
+ pandas/io/common.py:995: note: def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., *, mode: Literal['x:gz', 'x:bz2', 'w:gz', 'w:bz2'], fileobj: _Fileobj | None = ..., bufsize: int = ..., format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
+ pandas/io/common.py:995: note: def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | None, mode: Literal['x:xz', 'w:xz'], fileobj: _Fileobj | None = ..., bufsize: int = ..., *, format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: int | None = ..., errorlevel: int | None = ..., preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ...) -> TarFile
+ pandas/io/common.py:995: note: def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | None = ..., *, mode: Literal['x:xz', 'w:xz'], fileobj: _Fileobj | None = ..., bufsize: int = ..., format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: int | None = ..., errorlevel: int | None = ..., preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ...) -> TarFile
+ pandas/io/common.py:995: note: def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., *, mode: Literal['r|*', 'r|', 'r|gz', 'r|bz2', 'r|xz'], fileobj: _Fileobj | None = ..., bufsize: int = ..., format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note: def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., *, mode: Literal['w|', 'w|xz'], fileobj: _Fileobj | None = ..., bufsize: int = ..., format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: int | None = ..., errorlevel: int | None = ...) -> TarFile
+ pandas/io/common.py:995: note: def open(cls, name: str | bytes | PathLike[str] | PathLike[bytes] | Buffer | None = ..., *, mode: Literal['w|gz', 'w|bz2'], fileobj: _Fileobj | None = ..., bufsize: int = ..., format: int | None = ..., tarinfo: type[TarInfo] | None = ..., dereference: bool | None = ..., ignore_zeros: bool | None = ..., encoding: str | None = ..., errors: str = ..., pax_headers: Mapping[str, str] | None = ..., debug: int | None = ..., errorlevel: int | None = ..., compresslevel: int = ...) -> TarFile
+ pandas/io/common.py:1050: error: No overload variant of "ZipFile" matches argument types "str | PathLike[str] | ReadBuffer[bytes] | WriteBuffer[bytes]", "str", "dict[str, Any]" [call-overload]
+ pandas/io/common.py:1050: note: Error code "call-overload" not covered by "type: ignore" comment
+ pandas/io/common.py:1050: note: Possible overload variants:
+ pandas/io/common.py:1050: note: def __init__(self, file: str | PathLike[str] | IO[bytes], mode: Literal['r', 'w', 'x', 'a'] = ..., compression: int = ..., allowZip64: bool = ..., compresslevel: int | None = ..., *, strict_timestamps: bool = ..., metadata_encoding: str | None = ...) -> ZipFile
+ pandas/io/common.py:1050: note: def __init__(self, file: str | PathLike[str] | _ZipReadable, mode: Literal['r'] = ..., compression: int = ..., allowZip64: bool = ..., compresslevel: int | None = ..., *, strict_timestamps: bool = ..., metadata_encoding: str | None = ...) -> ZipFile
+ pandas/io/common.py:1050: note: def __init__(self, file: str | PathLike[str] | _ZipWritable, mode: Literal['w', 'x'] = ..., compression: int = ..., allowZip64: bool = ..., compresslevel: int | None = ..., *, strict_timestamps: bool = ..., metadata_encoding: None = ...) -> ZipFile
+ pandas/io/common.py:1050: note: def __init__(self, file: str | PathLike[str] | _ZipReadableTellable, mode: Literal['a'] = ..., compression: int = ..., allowZip64: bool = ..., compresslevel: int | None = ..., *, strict_timestamps: bool = ..., metadata_encoding: None = ...) -> ZipFile
+ pandas/core/arrays/period.py:183: error: Incompatible types in assignment (expression has type "Callable[[], bool]", base class "DatetimeLikeArrayMixin" defined the type as "Callable[[dtype[Any] | ExtensionDtype], bool]") [assignment]
+ pandas/core/arrays/timedeltas.py:150: error: Incompatible types in assignment (expression has type "Callable[[], bool]", base class "DatetimeLikeArrayMixin" defined the type as "Callable[[dtype[Any] | ExtensionDtype], bool]") [assignment]
+ pandas/core/arrays/datetimes.py:229: error: Incompatible types in assignment (expression has type "Callable[[], bool]", base class "DatetimeLikeArrayMixin" defined the type as "Callable[[dtype[Any] | ExtensionDtype], bool]") [assignment]
+ pandas/core/arrays/integer.py:29: error: Incompatible types in assignment (expression has type "Callable[[], bool]", base class "NumericDtype" defined the type as "Callable[[Any], bool]") [assignment]
+ pandas/core/arrays/floating.py:29: error: Incompatible types in assignment (expression has type "Callable[[], bool]", base class "NumericDtype" defined the type as "Callable[[Any], bool]") [assignment]
+ pandas/core/indexes/frozen.py:75: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/indexes/frozen.py:120: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/indexes/frozen.py:123: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/series.py:356: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/reshape/merge.py:2183: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/reshape/merge.py:2184: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/indexes/multi.py:3940: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/reshape/reshape.py:355: error: Unused "type: ignore" comment [unused-ignore]
werkzeug (https://github.com/pallets/werkzeug)
+ src/werkzeug/datastructures/headers.py:625: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/local.py:534: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/local.py:542: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/local.py:545: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/local.py:547: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/local.py:550: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/local.py:551: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/local.py:554: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/local.py:558: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/local.py:559: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/local.py:560: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/local.py:571: error: Unused "type: ignore" comment [unused-ignore]
+ tests/test_wrappers.py:1004: error: Incompatible types in assignment (expression has type "type[_ImmutableOrderedMultiDict[K, V]]", base class "Request" defined the type as "type[MultiDict[str, Any]]") [assignment]
- tests/test_wrappers.py:1036: error: Incompatible types in assignment (expression has type "type[dict[Any, Any]]", base class "Request" defined the type as "type[MultiDict[str, Any]]") [assignment]
+ tests/test_wrappers.py:1036: error: Incompatible types in assignment (expression has type "type[dict[_KT, _VT]]", base class "Request" defined the type as "type[MultiDict[str, Any]]") [assignment]
- tests/test_wrappers.py:1038: error: Incompatible types in assignment (expression has type "type[dict[Any, Any]]", base class "Request" defined the type as "type[MultiDict[str, Any]]") [assignment]
+ tests/test_wrappers.py:1038: error: Incompatible types in assignment (expression has type "type[dict[_KT, _VT]]", base class "Request" defined the type as "type[MultiDict[str, Any]]") [assignment]
- tests/test_routing.py:733: error: Cannot determine type of "default_converters" [has-type]
- tests/test_local.py:149: error: Cannot determine type of "__eq__" [has-type]
- tests/test_local.py:189: error: Cannot determine type of "__doc__" [has-type]
- tests/test_local.py:200: error: Cannot determine type of "__class__" [has-type]
- tests/test_local.py:201: error: Cannot determine type of "__doc__" [has-type]
steam.py (https://github.com/Gobot1234/steam.py)
- steam/trade.py:317: error: Cannot determine type of "REPR_ATTRS" [has-type]
+ steam/trade.py:317: error: Incompatible types in assignment (expression has type "tuple[str, str, str, str, str, str, str, str, str, str]", base class "Item" defined the type as "tuple[str, str, str, str, str, str, str, str]") [assignment]
+ steam/_gc/client.py:47: error: Unused "type: ignore" comment [unused-ignore]
- steam/ext/csgo/backpack.py:291: error: Cannot determine type of "REPR_ATTRS" [has-type]
+ steam/ext/csgo/backpack.py:291: error: Incompatible types in assignment (expression has type "tuple[str, str, str, str, str, str, str, str, str]", base class "Item" defined the type as "tuple[str, str, str, str, str, str, str, str]") [assignment]
+ steam/ext/csgo/backpack.py:358: error: Incompatible types in assignment (expression has type "tuple[str, str, str, str, str, str, str, str, str, str]", base class "BackpackItem" defined the type as "tuple[str, str, str, str, str, str, str, str, str]") [assignment]
- steam/ext/tf2/backpack.py:80: error: Cannot determine type of "REPR_ATTRS" [has-type]
+ steam/ext/tf2/backpack.py:80: error: Incompatible types in assignment (expression has type "tuple[str, str, str, str, str, str, str, str, str, str]", base class "Item" defined the type as "tuple[str, str, str, str, str, str, str, str]") [assignment]
sympy (https://github.com/sympy/sympy)
+ sympy/core/containers.py:334: error: Incompatible types in assignment (expression has type "Callable[[Basic], Any]", base class "Basic" defined the type as "Callable[[], int]") [assignment]
+ sympy/sets/sets.py:2186: error: Incompatible types in assignment (expression has type "Callable[[Basic], Any]", base class "Basic" defined the type as "Callable[[], int]") [assignment]
+ sympy/matrices/expressions/diagonal.py:52: error: Unused "type: ignore" comment [unused-ignore]
+ sympy/matrices/expressions/fourier.py:49: error: Unused "type: ignore" comment [unused-ignore]
+ sympy/matrices/expressions/fourier.py:50: error: Unused "type: ignore" comment [unused-ignore]
+ sympy/matrices/expressions/factorizations.py:6: error: Unused "type: ignore" comment [unused-ignore]
+ sympy/physics/biomechanics/musculotendon.py:1416: error: Incompatible types in assignment (expression has type "CharacteristicCurveCollection", base class "MusculotendonBase" defined the type as "Callable[[], Any]") [assignment]
freqtrade (https://github.com/freqtrade/freqtrade)
+ freqtrade/persistence/trade_model.py:1646: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1650: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1655: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1656: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1657: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1658: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1659: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1660: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1661: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1662: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1665: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1668: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1669: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1672: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1673: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1677: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1678: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1679: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1680: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1683: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1684: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1685: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1686: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1687: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1688: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1689: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1692: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1694: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1696: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1698: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1702: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1705: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1709: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1713: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1714: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1717: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1720: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1721: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1724: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1726: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1729: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1732: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1733: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1734: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1737: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1740: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1741: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1742: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1747: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1752: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1755: error: Unused "type: ignore" comment [unused-ignore]
+ freqtrade/persistence/trade_model.py:1759: error: Unused "type: ignore" comment [unused-ignore]
jinja (https://github.com/pallets/jinja)
+ src/jinja2/nativetypes.py:108: error: Unused "type: ignore" comment [unused-ignore]
+ src/jinja2/nativetypes.py:123: error: Unused "type: ignore" comment [unused-ignore]
antidote (https://github.com/Finistere/antidote)
+ tests/core/test_inject_wrapper.py:246: error: Unused "type: ignore" comment [unused-ignore]
+ tests/core/test_inject_wrapper.py:252: error: Unused "type: ignore" comment [unused-ignore]
+ tests/core/test_inject_wrapper.py:258: error: Unused "type: ignore" comment [unused-ignore]
+ tests/core/test_inject_wrapper.py:354: error: Unused "type: ignore" comment [unused-ignore]
+ tests/core/test_inject_wrapper.py:360: error: Unused "type: ignore" comment [unused-ignore]
+ tests/core/test_inject_wrapper.py:366: error: Unused "type: ignore" comment [unused-ignore]
django-stubs (https://github.com/typeddjango/django-stubs)
+ django-stubs/db/models/fields/related.pyi:245: error: Incompatible types in assignment (expression has type "Union[str, _StrPromise]", base class "Field" defined the type as "str") [assignment]
scrapy (https://github.com/scrapy/scrapy)
+ tests/test_spidermiddleware_referer.py:1047: error: Incompatible types in assignment (expression has type "list[tuple[str, str, tuple[tuple[int, str], ...], None, None]]", base class "TestReferrerOnRedirect" defined the type as "list[tuple[str, str, tuple[tuple[int, str], ...], bytes | None, bytes | None]]") [assignment]
+ tests/test_spidermiddleware_referer.py:1047: note: "list" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
+ tests/test_spidermiddleware_referer.py:1047: note: Consider using "Sequence" instead, which is covariant
+ tests/test_spidermiddleware_referer.py:1086: error: Incompatible types in assignment (expression has type "list[tuple[str, str, tuple[tuple[int, str], ...], bytes, bytes | None]]", base class "TestReferrerOnRedirect" defined the type as "list[tuple[str, str, tuple[tuple[int, str], ...], bytes | None, bytes | None]]") [assignment]
+ tests/test_spidermiddleware_referer.py:1086: note: "list" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
+ tests/test_spidermiddleware_referer.py:1086: note: Consider using "Sequence" instead, which is covariant
+ tests/test_spidermiddleware_referer.py:1207: error: Incompatible types in assignment (expression has type "list[tuple[str, str, tuple[tuple[int, str], ...], bytes, bytes]]", base class "TestReferrerOnRedirect" defined the type as "list[tuple[str, str, tuple[tuple[int, str], ...], bytes | None, bytes | None]]") [assignment]
+ tests/test_spidermiddleware_referer.py:1207: note: "list" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
+ tests/test_spidermiddleware_referer.py:1207: note: Consider using "Sequence" instead, which is covariant
ibis (https://github.com/ibis-project/ibis)
- ibis/backends/athena/__init__.py:279: error: Argument 1 to "Schema" has incompatible type "dict[Any, Any]"; expected "FrozenOrderedDict[str, DataType]" [arg-type]
+ ibis/backends/athena/__init__.py:279: error: Argument 1 to "Schema" has incompatible type "dict[Any, DataType]"; expected "FrozenOrderedDict[str, DataType]" [arg-type]
- ibis/backends/athena/__init__.py:280: error: Cannot determine type of "type_mapper" [has-type]
- ibis/backends/athena/__init__.py:635: error: Cannot determine type of "type_mapper" [has-type]
- ibis/backends/athena/__init__.py:637: error: Argument 1 to "Schema" has incompatible type "dict[Any, Any]"; expected "FrozenOrderedDict[str, DataType]" [arg-type]
+ ibis/backends/athena/__init__.py:637: error: Argument 1 to "Schema" has incompatible type "dict[Any, DataType]"; expected "FrozenOrderedDict[str, DataType]" [arg-type]
jax (https://github.com/google/jax)
+ jax/_src/prng.py:212: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/prng.py:213: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/prng.py:214: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/prng.py:215: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/prng.py:216: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/prng.py:217: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/prng.py:218: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/earray.py:58: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/earray.py:59: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/earray.py:62: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/earray.py:63: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/earray.py:64: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/earray.py:70: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/earray.py:72: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/earray.py:73: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/earray.py:74: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/earray.py:75: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/earray.py:76: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/earray.py:77: error: Unused "type: ignore" comment [unused-ignore]
core (https://github.com/home-assistant/core)
- homeassistant/components/script/__init__.py:543: error: Incompatible types in assignment (expression has type "None", base class "Entity" defined the type as "Callable[[Entity], str | None]") [assignment]
- homeassistant/components/script/__init__.py:556: error: Cannot determine type of "icon" [has-type]
- homeassistant/components/tikteck/light.py:63: error: Incompatible types in assignment (expression has type "tuple[float, float]", base class "LightEntity" defined the type as "Callable[[LightEntity], tuple[float, float] | None]") [assignment]
- homeassistant/components/tikteck/light.py:64: error: Incompatible types in assignment (expression has type "int", base class "LightEntity" defined the type as "Callable[[LightEntity], int | None]") [assignment]
- homeassistant/components/zoneminder/switch.py:62: error: Incompatible types in assignment (expression has type "str", base class "Entity" defined the type as "Callable[[Entity], str | None]") [assignment]
- homeassistant/components/xiaomi_miio/humidifier.py:176: error: Incompatible types in assignment (expression has type "list[str]", base class "HumidifierEntity" defined the type as "Callable[[HumidifierEntity], list[str] | None]") [assignment]
- homeassistant/components/vlc_telnet/media_player.py:96: error: Incompatible types in assignment (expression has type "int", base class "MediaPlayerEntity" defined the type as "Callable[[MediaPlayerEntity], float | None]") [assignment]
- homeassistant/components/moehlenhoff_alpha2/climate.py:42: error: Incompatible types in assignment (expression has type "float", base class "ClimateEntity" defined the type as "Callable[[ClimateEntity], float | None]") [assignment]
- homeassistant/components/balboa/time.py:38: error: Incompatible types in assignment (expression has type "EntityCategory", base class "Entity" defined the type as "Callable[[Entity], EntityCategory | None]") [assignment]
- homeassistant/components/vodafone_station/device_tracker.py:73: error: Incompatible types in assignment (expression has type "str", base class "ScannerEntity" defined the type as "Callable[[ScannerEntity], str | None]") [assignment]
- homeassistant/components/hue/v1/sensor_base.py:171: error: Incompatible types in assignment (expression has type "bool", base class "Entity" defined the type as "Callable[[Entity], bool]") [assignment]
- homeassistant/components/synology_dsm/entity.py:33: error: Incompatible types in assignment (expression has type "str", base class "Entity" defined the type as "Callable[[Entity], str | None]") [assignment]
- homeassistant/components/roborock/image.py:46: error: Incompatible types in assignment (expression has type "datetime", base class "ImageEntity" defined the type as "Callable[[ImageEntity], datetime | None]") [assignment]
asynq (https://github.com/quora/asynq)
+ asynq/decorators.pyi:104: error: Unused "type: ignore" comment [unused-ignore]
bokeh (https://github.com/bokeh/bokeh)
+ release/action.py: note: In class "FAILED":
+ release/action.py:42:10: error: Incompatible types in assignment (expression has type "Callable[[Sequence[str] | None], str]", base class "ActionReturn" defined the type as "Callable[[str, Sequence[str] | None], str]") [assignment]
+ release/action.py: note: In class "PASSED":
+ release/action.py:49:10: error: Incompatible types in assignment (expression has type "Callable[[Sequence[str] | None], str]", base class "ActionReturn" defined the type as "Callable[[str, Sequence[str] | None], str]") [assignment]
+ release/action.py: note: In class "SKIPPED":
+ release/action.py:56:10: error: Incompatible types in assignment (expression has type "Callable[[Sequence[str] | None], str]", base class "ActionReturn" defined the type as "Callable[[str, Sequence[str] | None], str]") [assignment]
pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/python_api.py:466: error: Unused "type: ignore" comment [unused-ignore]
|
Sorry, something went wrong.
|
@sterliakov I still think it should be run on-demand, i.e. I want to be able to trigger a run on PRs where I expect significant fallout (like this one). This can be done using workflow_dispatch (example of how it is done in typeshed stub uploader https://github.com/typeshed-internal/stub_uploader/blob/main/.github/workflows/force_update.yml#L3-L8) Btw few comments on the issues:
|
Sorry, something went wrong.
|
workflow_dispatch is possible, but has one big drawback: only repo owners (or at least those with write access) can dispatch such workflows. So I won't be able to run that workflow myself. The semi-canonical solution to on-demand checks is a simple workflow on issue_comment with /pull/ source (so you can comment /check-issues on a PR to run, that's almost exactly what I'm doing in that repo) or a home-grown bot (like bedevere-app in core CPython or rustbot in rust-lang), but the latter is probably overkill for such a simple task. (But let's move this discussion out of this PR, I'll create a separate issue) As for #17981, my personal preference would be to not narrow in subclasses fields explicitly annotated in superclass (but allow explicit narrowing with annotation), but this may not align with your vision. This would help me remove a few redundant annotations in class hierarchies. This PR at least improves handling of such cases, eliminating the strange "cannot determine type" error. And could you edit "fixes" issues into PR description to close everything upon merging automatically? |
Sorry, something went wrong.
There was a problem hiding this comment.
Looks good, love to see so many type ignore comments that are now redundant.
Sorry, something went wrong.
Bisected to python/mypy#18847 Some of these look valid, others might be due to bugs, e.g. duplicate note output that might need to be fixed in mypy?
| Back | FazBrowse Home | New Git URL |
Fixes #5803
Fixes #18695
Fixes #17513
Fixes #13194
Fixes #12126
This is the first PR towards #7724, some notes: