Handle `__hash__ = None` in somewhat more intuitive fashion
Fixes #4266. Fixes #18622. Refs #2455.
This is the first step towards checking hashability of dict keys (and Hashable compatibility in general). This PR implements the following rules:
-
__hash__ = Noneis only allowed on classes who inherited__hash__directly fromobject(no redefinitions in MRO) -
def __hash__is allowed on subclasses whose parents declare__hash__ = None- it is a relatively common solution to derive a hashable subclass, and LSP violation only meansassert SomeCls.__hash__ is Nonewill not pass for subclasses. This sounds safe enough. - Classes defining
__eq__without__hash__get their__hash__assigned toNoneto match runtime semantics. Protocols are exempt from this as defining__eq__on protocol just requires classes that support__eq__, not necessarily unhashable ones.
Refs #19043.
Diff from mypy_primer, showing the effect of this PR on open source code:
archinstall (https://github.com/archlinux/archinstall)
+ archinstall/lib/luks.py:58: error: Subclass of "Password" and "bytes" cannot exist: would have incompatible method signatures [unreachable]
+ archinstall/lib/luks.py:59: error: Statement is unreachable [unreachable]
prefect (https://github.com/PrefectHQ/prefect)
+ src/prefect/_internal/concurrency/calls.py:273: error: Unused "type: ignore" comment [unused-ignore]
mkdocs (https://github.com/mkdocs/mkdocs)
+ mkdocs/utils/templates.py:47: error: Subclass of "ExtraScriptValue" and "str" cannot exist: would have incompatible method signatures [unreachable]
ibis (https://github.com/ibis-project/ibis)
- ibis/common/collections.py:289: error: Signature of "__hash__" incompatible with supertype "dict" [override]
- ibis/common/collections.py:289: note: Superclass:
- ibis/common/collections.py:289: note: None
- ibis/common/collections.py:289: note: Subclass:
- ibis/common/collections.py:289: note: def __hash__(self) -> int
- ibis/common/collections.py:311: error: Signature of "__hash__" incompatible with supertype "dict" [override]
- ibis/common/collections.py:311: note: Superclass:
- ibis/common/collections.py:311: note: None
- ibis/common/collections.py:311: note: Subclass:
- ibis/common/collections.py:311: note: def __hash__(self) -> int
+ ibis/common/deferred.py:211: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Resolver" [misc]
+ ibis/common/deferred.py:234: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Resolver" [misc]
+ ibis/common/deferred.py:274: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Resolver" [misc]
+ ibis/common/deferred.py:303: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Resolver" [misc]
+ ibis/common/deferred.py:330: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Resolver" [misc]
+ ibis/common/deferred.py:350: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Resolver" [misc]
+ ibis/common/deferred.py:370: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Resolver" [misc]
+ ibis/common/deferred.py:449: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Resolver" [misc]
+ ibis/common/deferred.py:467: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Resolver" [misc]
+ ibis/common/deferred.py:487: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Resolver" [misc]
+ ibis/common/deferred.py:507: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Resolver" [misc]
+ ibis/common/patterns.py:293: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:313: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:323: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:330: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:363: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:401: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:438: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:459: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:480: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:513: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:540: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:589: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:608: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:673: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:734: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:770: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:813: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:883: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:951: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:984: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:1038: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:1064: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:1090: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:1116: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:1162: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:1220: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:1264: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:1284: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:1356: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:1383: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:1423: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:1442: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:1480: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/patterns.py:1534: error: Definition of "__hash__" in base class "FrozenSlotted" is incompatible with definition in base class "Pattern" [misc]
+ ibis/expr/datatypes/core.py:916: error: Definition of "__hash__" in base class "Concrete" is incompatible with definition in base class "Mapping" [misc]
+ ibis/expr/schema.py:25: error: Definition of "__hash__" in base class "Concrete" is incompatible with definition in base class "Mapping" [misc]
+ ibis/expr/rules.py:141: error: Definition of "__hash__" in base class "Concrete" is incompatible with definition in base class "Pattern" [misc]
+ ibis/common/tests/test_grounds.py:142: error: Definition of "__hash__" in base class "Concrete" is incompatible with definition in base class "Mapping" [misc]
mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ bson/regex.py:112: error: Unused "type: ignore" comment [unused-ignore]
pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/arrays/base.py:2207: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/indexes/frozen.py:103: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/generic.py:1872: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/indexes/base.py:5205: error: Unused "type: ignore" comment [unused-ignore]
asynq (https://github.com/quora/asynq)
+ asynq/tests/test_tools.py:183: error: Unused "type: ignore" comment [unused-ignore]
schema_salad (https://github.com/common-workflow-language/schema_salad)
+ schema_salad/jsonld_context.py: note: In function "pred":
+ schema_salad/jsonld_context.py:53:31: error: Subclass of "str" and "MutableMapping[Any, Any]" cannot exist: would have incompatible method signatures [unreachable]
+ schema_salad/jsonld_context.py:54:21: error: Statement is unreachable [unreachable]
+ schema_salad/schema.py: note: In function "get_anon_name":
+ schema_salad/schema.py:422:27: error: Subclass of "str" and "Mapping[Any, Any]" cannot exist: would have incompatible method signatures [unreachable]
+ schema_salad/schema.py:423:17: error: Statement is unreachable [unreachable]
jax (https://github.com/google/jax)
+ jax/_src/core.py:490: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/core.py:777: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/prng.py:300: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/earray.py:33: error: Unused "type: ignore" comment [unused-ignore]
+ jax/experimental/sparse/_base.py:34: error: Unused "type: ignore" comment [unused-ignore]
pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/python_api.py:88: error: Unused "type: ignore" comment [unused-ignore]
+ src/_pytest/_code/source.py:50: error: Unused "type: ignore" comment [unused-ignore]
+ src/_pytest/_code/code.py:77: error: Unused "type: ignore" comment [unused-ignore]
starlette (https://github.com/encode/starlette)
+ starlette/requests.py:94: error: Incompatible types in assignment (expression has type "Callable[[], int]", base class "Mapping" defined the type as "None") [assignment]
werkzeug (https://github.com/pallets/werkzeug)
+ src/werkzeug/datastructures/structures.py:648: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/datastructures/headers.py:108: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/routing/rules.py:912: error: Unused "type: ignore" comment [unused-ignore]
static-frame (https://github.com/static-frame/static-frame)
+ static_frame/core/series.py:3170: error: Incompatible return value type (got "IndexBase", expected "TLabel | ndarray[Any, Any]") [return-value]
+ static_frame/core/frame.py:6688: error: Argument 1 to "index_from_optional_constructors" has incompatible type "TypeBlocks"; expected "TIndexInitializer" [arg-type]
+ static_frame/core/frame.py:6688: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:6688: note: Expected:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:6688: note: Got:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6688: note: Expected:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:6688: note: Got:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6688: note: Expected:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:6688: note: Got:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6688: note: Expected:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:6688: note: Got:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6914: error: Argument 1 to "index_from_optional_constructors" has incompatible type "TypeBlocks"; expected "TIndexInitializer" [arg-type]
+ static_frame/core/frame.py:6914: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:6914: note: Expected:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:6914: note: Got:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6914: note: Expected:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:6914: note: Got:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6914: note: Expected:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:6914: note: Got:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6914: note: Expected:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:6914: note: Got:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[TypeBlocks]
pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ pandas-stubs/core/indexes/frozen.pyi:9: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/generic.pyi:67: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/frame.pyi:312: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/indexes/base.pyi:72: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/groupby/generic.pyi:167: error: Return type "Iterator[tuple[ByT, Series[S1]]]" of "__iter__" incompatible with return type "Iterator[tuple[Hashable, Series[S1]]]" in supertype "BaseGroupBy" [override]
+ pandas-stubs/core/groupby/generic.pyi:378: error: Return type "Iterator[tuple[ByT, DataFrame]]" of "__iter__" incompatible with return type "Iterator[tuple[Hashable, DataFrame]]" in supertype "BaseGroupBy" [override]
beartype (https://github.com/beartype/beartype)
+ beartype/_util/kind/map/utilmapfrozen.py:70: error: Unused "type: ignore" comment [unused-ignore]
+ beartype/_check/metadata/metadecor.py:249: error: Unused "type: ignore" comment [unused-ignore]
+ beartype/_check/metadata/metacheck.py:97: error: Unused "type: ignore" comment [unused-ignore]
spack (https://github.com/spack/spack)
+ lib/spack/spack/package_base.py:767: error: Value of type variable "K" of "_subkeys" cannot be "str" [type-var]
+ lib/spack/spack/package_base.py:776: error: Value of type variable "K" of "_num_definitions" cannot be "str" [type-var]
+ lib/spack/spack/package_base.py:781: error: Value of type variable "K" of "_definitions" cannot be "str" [type-var]
scrapy (https://github.com/scrapy/scrapy)
+ scrapy/item.py:119: error: Incompatible types in assignment (expression has type "Callable[[], int]", base class "Mapping" defined the type as "None") [assignment]
xarray (https://github.com/pydata/xarray)
+ xarray/core/_typed_ops.py:93: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:362: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:736: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1164: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1376: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1502: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataset.py:1430: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataset.py: note: In class "Dataset":
+ xarray/core/dataset.py:1430: error: Cannot override instance variable (previously declared on base class "DatasetOpsMixin") with class variable [misc]
+ xarray/core/dataset.py:1430: note: Error code "misc" not covered by "type: ignore" comment
+ xarray/core/dataset.py: note: At top level:
+ xarray/core/dataarray.py:1312: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataarray.py: note: In member "rename" of class "DataArray":
+ xarray/core/dataarray.py:2549: error: Argument "name" to "_replace" of "DataArray" has incompatible type "Hashable | Mapping[Any, Hashable]"; expected "Hashable | Default | None" [arg-type]
+ xarray/core/dataarray.py: note: At top level:
+ xarray/core/datatree.py:301: error: Unused "type: ignore" comment [unused-ignore]
django-stubs (https://github.com/typeddjango/django-stubs)
+ django-stubs/contrib/gis/geos/linestring.pyi:6: error: Definition of "__hash__" in base class "GEOSGeometryBase" is incompatible with definition in base class "ListMixin" [misc]
+ django-stubs/contrib/gis/geos/geometry.pyi:146: error: Definition of "__hash__" in base class "GEOSGeometryBase" is incompatible with definition in base class "ListMixin" [misc]
+ django-stubs/contrib/gis/geos/collections.pyi:16: error: Definition of "__hash__" in base class "GEOSGeometryBase" is incompatible with definition in base class "ListMixin" [misc]
sympy (https://github.com/sympy/sympy)
+ sympy/matrices/immutable.py:45: error: Incompatible types in assignment (expression has type "Callable[[], int]", base class "RepMatrix" defined the type as "None") [assignment]
Diff from mypy_primer, showing the effect of this PR on open source code:
antidote (https://github.com/Finistere/antidote): 1.21x slower (73.4s -> 88.6s in single noisy sample)
prefect (https://github.com/PrefectHQ/prefect)
+ src/prefect/_internal/concurrency/calls.py:273: error: Unused "type: ignore" comment [unused-ignore]
mkdocs (https://github.com/mkdocs/mkdocs)
+ mkdocs/utils/templates.py:47: error: Subclass of "ExtraScriptValue" and "str" cannot exist: would have incompatible method signatures [unreachable]
ibis (https://github.com/ibis-project/ibis)
- ibis/common/collections.py:289: error: Signature of "__hash__" incompatible with supertype "dict" [override]
- ibis/common/collections.py:289: note: Superclass:
- ibis/common/collections.py:289: note: None
- ibis/common/collections.py:289: note: Subclass:
- ibis/common/collections.py:289: note: def __hash__(self) -> int
- ibis/common/collections.py:311: error: Signature of "__hash__" incompatible with supertype "dict" [override]
- ibis/common/collections.py:311: note: Superclass:
- ibis/common/collections.py:311: note: None
- ibis/common/collections.py:311: note: Subclass:
- ibis/common/collections.py:311: note: def __hash__(self) -> int
mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ bson/regex.py:112: error: Unused "type: ignore" comment [unused-ignore]
pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/arrays/base.py:2207: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/indexes/frozen.py:103: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/generic.py:1872: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/indexes/base.py:5209: error: Unused "type: ignore" comment [unused-ignore]
asynq (https://github.com/quora/asynq)
+ asynq/tests/test_tools.py:183: error: Unused "type: ignore" comment [unused-ignore]
schema_salad (https://github.com/common-workflow-language/schema_salad)
+ schema_salad/jsonld_context.py: note: In function "pred":
+ schema_salad/jsonld_context.py:53:31: error: Subclass of "str" and "MutableMapping[Any, Any]" cannot exist: would have incompatible method signatures [unreachable]
+ schema_salad/jsonld_context.py:54:21: error: Statement is unreachable [unreachable]
+ schema_salad/schema.py: note: In function "get_anon_name":
+ schema_salad/schema.py:422:27: error: Subclass of "str" and "Mapping[Any, Any]" cannot exist: would have incompatible method signatures [unreachable]
+ schema_salad/schema.py:423:17: error: Statement is unreachable [unreachable]
jax (https://github.com/google/jax)
+ jax/_src/core.py:523: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/core.py:811: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/earray.py:33: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/prng.py:300: error: Unused "type: ignore" comment [unused-ignore]
+ jax/experimental/sparse/_base.py:34: error: Unused "type: ignore" comment [unused-ignore]
pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/python_api.py:88: error: Unused "type: ignore" comment [unused-ignore]
+ src/_pytest/_code/source.py:50: error: Unused "type: ignore" comment [unused-ignore]
+ src/_pytest/_code/code.py:77: error: Unused "type: ignore" comment [unused-ignore]
starlette (https://github.com/encode/starlette)
+ starlette/requests.py:94: error: Incompatible types in assignment (expression has type "Callable[[], int]", base class "Mapping" defined the type as "None") [assignment]
werkzeug (https://github.com/pallets/werkzeug)
+ src/werkzeug/datastructures/structures.py:648: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/datastructures/headers.py:108: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/routing/rules.py:912: error: Unused "type: ignore" comment [unused-ignore]
static-frame (https://github.com/static-frame/static-frame)
+ static_frame/core/series.py:3170: error: Incompatible return value type (got "IndexBase", expected "TLabel | ndarray[Any, Any]") [return-value]
+ static_frame/core/frame.py:6688: error: Argument 1 to "index_from_optional_constructors" has incompatible type "TypeBlocks"; expected "TIndexInitializer" [arg-type]
+ static_frame/core/frame.py:6688: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:6688: note: Expected:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:6688: note: Got:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6688: note: Expected:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:6688: note: Got:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6688: note: Expected:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:6688: note: Got:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6688: note: Expected:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:6688: note: Got:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6914: error: Argument 1 to "index_from_optional_constructors" has incompatible type "TypeBlocks"; expected "TIndexInitializer" [arg-type]
+ static_frame/core/frame.py:6914: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:6914: note: Expected:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:6914: note: Got:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6914: note: Expected:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:6914: note: Got:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6914: note: Expected:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:6914: note: Got:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6914: note: Expected:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:6914: note: Got:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[TypeBlocks]
pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ pandas-stubs/core/indexes/frozen.pyi:9: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/generic.pyi:67: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/frame.pyi:312: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/indexes/base.pyi:72: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/groupby/generic.pyi:167: error: Return type "Iterator[tuple[ByT, Series[S1]]]" of "__iter__" incompatible with return type "Iterator[tuple[Hashable, Series[S1]]]" in supertype "BaseGroupBy" [override]
+ pandas-stubs/core/groupby/generic.pyi:378: error: Return type "Iterator[tuple[ByT, DataFrame]]" of "__iter__" incompatible with return type "Iterator[tuple[Hashable, DataFrame]]" in supertype "BaseGroupBy" [override]
imagehash (https://github.com/JohannesBuchner/imagehash): 1.06x slower (78.5s -> 83.1s in single noisy sample)
beartype (https://github.com/beartype/beartype)
+ beartype/_util/kind/map/utilmapfrozen.py:70: error: Unused "type: ignore" comment [unused-ignore]
+ beartype/_check/metadata/metadecor.py:249: error: Unused "type: ignore" comment [unused-ignore]
+ beartype/_check/metadata/metacheck.py:97: error: Unused "type: ignore" comment [unused-ignore]
spack (https://github.com/spack/spack)
+ lib/spack/spack/package_base.py:767: error: Value of type variable "K" of "_subkeys" cannot be "str" [type-var]
+ lib/spack/spack/package_base.py:776: error: Value of type variable "K" of "_num_definitions" cannot be "str" [type-var]
+ lib/spack/spack/package_base.py:781: error: Value of type variable "K" of "_definitions" cannot be "str" [type-var]
discord.py (https://github.com/Rapptz/discord.py): 1.10x faster (286.9s -> 261.8s in single noisy sample)
scrapy (https://github.com/scrapy/scrapy)
+ scrapy/item.py:119: error: Incompatible types in assignment (expression has type "Callable[[], int]", base class "Mapping" defined the type as "None") [assignment]
xarray (https://github.com/pydata/xarray)
+ xarray/core/_typed_ops.py:93: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:362: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:736: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1164: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1376: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1502: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataset.py:1430: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataset.py: note: In class "Dataset":
+ xarray/core/dataset.py:1430: error: Cannot override instance variable (previously declared on base class "DatasetOpsMixin") with class variable [misc]
+ xarray/core/dataset.py:1430: note: Error code "misc" not covered by "type: ignore" comment
+ xarray/core/dataset.py: note: At top level:
+ xarray/core/dataarray.py:1312: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataarray.py: note: In member "rename" of class "DataArray":
+ xarray/core/dataarray.py:2549: error: Argument "name" to "_replace" of "DataArray" has incompatible type "Hashable | Mapping[Any, Hashable]"; expected "Hashable | Default | None" [arg-type]
+ xarray/core/dataarray.py: note: At top level:
+ xarray/core/datatree.py:301: error: Unused "type: ignore" comment [unused-ignore]
sympy (https://github.com/sympy/sympy)
+ sympy/matrices/immutable.py:45: error: Incompatible types in assignment (expression has type "Callable[[], int]", base class "RepMatrix" defined the type as "None") [assignment]
Diff from mypy_primer, showing the effect of this PR on open source code:
typeshed-stats (https://github.com/AlexWaygood/typeshed-stats): 1.09x slower (57.4s -> 62.8s in single noisy sample)
prefect (https://github.com/PrefectHQ/prefect): 1.09x slower (66.7s -> 73.1s in single noisy sample)
+ src/prefect/_internal/concurrency/calls.py:273: error: Unused "type: ignore" comment [unused-ignore]
mkdocs (https://github.com/mkdocs/mkdocs)
+ mkdocs/utils/templates.py:47: error: Subclass of "ExtraScriptValue" and "str" cannot exist: would have incompatible method signatures [unreachable]
ibis (https://github.com/ibis-project/ibis)
- ibis/common/collections.py:289: error: Signature of "__hash__" incompatible with supertype "dict" [override]
- ibis/common/collections.py:289: note: Superclass:
- ibis/common/collections.py:289: note: None
- ibis/common/collections.py:289: note: Subclass:
- ibis/common/collections.py:289: note: def __hash__(self) -> int
- ibis/common/collections.py:311: error: Signature of "__hash__" incompatible with supertype "dict" [override]
- ibis/common/collections.py:311: note: Superclass:
- ibis/common/collections.py:311: note: None
- ibis/common/collections.py:311: note: Subclass:
- ibis/common/collections.py:311: note: def __hash__(self) -> int
mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ bson/regex.py:112: error: Unused "type: ignore" comment [unused-ignore]
pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/arrays/base.py:2207: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/indexes/frozen.py:103: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/generic.py:1872: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/indexes/base.py:5209: error: Unused "type: ignore" comment [unused-ignore]
asynq (https://github.com/quora/asynq)
+ asynq/tests/test_tools.py:183: error: Unused "type: ignore" comment [unused-ignore]
jax (https://github.com/google/jax)
+ jax/_src/core.py:523: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/core.py:811: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/earray.py:33: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/prng.py:300: error: Unused "type: ignore" comment [unused-ignore]
+ jax/experimental/sparse/_base.py:34: error: Unused "type: ignore" comment [unused-ignore]
schema_salad (https://github.com/common-workflow-language/schema_salad)
+ schema_salad/jsonld_context.py: note: In function "pred":
+ schema_salad/jsonld_context.py:53:31: error: Subclass of "str" and "MutableMapping[Any, Any]" cannot exist: would have incompatible method signatures [unreachable]
+ schema_salad/jsonld_context.py:54:21: error: Statement is unreachable [unreachable]
+ schema_salad/schema.py: note: In function "get_anon_name":
+ schema_salad/schema.py:422:27: error: Subclass of "str" and "Mapping[Any, Any]" cannot exist: would have incompatible method signatures [unreachable]
+ schema_salad/schema.py:423:17: error: Statement is unreachable [unreachable]
mypy (https://github.com/python/mypy): 1.06x slower (94.2s -> 99.5s in single noisy sample)
pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/python_api.py:88: error: Unused "type: ignore" comment [unused-ignore]
+ src/_pytest/_code/source.py:50: error: Unused "type: ignore" comment [unused-ignore]
+ src/_pytest/_code/code.py:77: error: Unused "type: ignore" comment [unused-ignore]
starlette (https://github.com/encode/starlette)
+ starlette/requests.py:94: error: Incompatible types in assignment (expression has type "Callable[[], int]", base class "Mapping" defined the type as "None") [assignment]
werkzeug (https://github.com/pallets/werkzeug)
+ src/werkzeug/datastructures/structures.py:648: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/datastructures/headers.py:108: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/routing/rules.py:912: error: Unused "type: ignore" comment [unused-ignore]
static-frame (https://github.com/static-frame/static-frame)
+ static_frame/core/series.py:3170: error: Incompatible return value type (got "IndexBase", expected "TLabel | ndarray[Any, Any]") [return-value]
+ static_frame/core/frame.py:6688: error: Argument 1 to "index_from_optional_constructors" has incompatible type "TypeBlocks"; expected "TIndexInitializer" [arg-type]
+ static_frame/core/frame.py:6688: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:6688: note: Expected:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:6688: note: Got:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6688: note: Expected:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:6688: note: Got:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6688: note: Expected:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:6688: note: Got:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6688: note: Expected:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:6688: note: Got:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6914: error: Argument 1 to "index_from_optional_constructors" has incompatible type "TypeBlocks"; expected "TIndexInitializer" [arg-type]
+ static_frame/core/frame.py:6914: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:6914: note: Expected:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:6914: note: Got:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6914: note: Expected:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:6914: note: Got:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6914: note: Expected:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:6914: note: Got:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6914: note: Expected:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:6914: note: Got:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[TypeBlocks]
pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ pandas-stubs/core/indexes/frozen.pyi:9: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/generic.pyi:67: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/frame.pyi:312: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/indexes/base.pyi:72: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/groupby/generic.pyi:167: error: Return type "Iterator[tuple[ByT, Series[S1]]]" of "__iter__" incompatible with return type "Iterator[tuple[Hashable, Series[S1]]]" in supertype "BaseGroupBy" [override]
+ pandas-stubs/core/groupby/generic.pyi:378: error: Return type "Iterator[tuple[ByT, DataFrame]]" of "__iter__" incompatible with return type "Iterator[tuple[Hashable, DataFrame]]" in supertype "BaseGroupBy" [override]
beartype (https://github.com/beartype/beartype)
+ beartype/_util/kind/map/utilmapfrozen.py:70: error: Unused "type: ignore" comment [unused-ignore]
+ beartype/_check/metadata/metadecor.py:249: error: Unused "type: ignore" comment [unused-ignore]
+ beartype/_check/metadata/metacheck.py:97: error: Unused "type: ignore" comment [unused-ignore]
scrapy (https://github.com/scrapy/scrapy)
+ scrapy/item.py:119: error: Incompatible types in assignment (expression has type "Callable[[], int]", base class "Mapping" defined the type as "None") [assignment]
xarray (https://github.com/pydata/xarray)
+ xarray/core/_typed_ops.py:93: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:362: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:736: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1164: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1376: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1502: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataset.py:1430: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataset.py: note: In class "Dataset":
+ xarray/core/dataset.py:1430: error: Cannot override instance variable (previously declared on base class "DatasetOpsMixin") with class variable [misc]
+ xarray/core/dataset.py:1430: note: Error code "misc" not covered by "type: ignore" comment
+ xarray/core/dataset.py: note: At top level:
+ xarray/core/dataarray.py:1312: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataarray.py: note: In member "rename" of class "DataArray":
+ xarray/core/dataarray.py:2549: error: Argument "name" to "_replace" of "DataArray" has incompatible type "Hashable | Mapping[Any, Hashable]"; expected "Hashable | Default | None" [arg-type]
+ xarray/core/dataarray.py: note: At top level:
+ xarray/core/datatree.py:301: error: Unused "type: ignore" comment [unused-ignore]
sympy (https://github.com/sympy/sympy)
+ sympy/matrices/immutable.py:45: error: Incompatible types in assignment (expression has type "Callable[[], int]", base class "RepMatrix" defined the type as "None") [assignment]
Diff from mypy_primer, showing the effect of this PR on open source code:
build (https://github.com/pypa/build): 2.29x faster (28.7s -> 12.5s in single noisy sample)
typeshed-stats (https://github.com/AlexWaygood/typeshed-stats): 1.07x slower (97.1s -> 103.8s in single noisy sample)
prefect (https://github.com/PrefectHQ/prefect): 1.09x slower (87.9s -> 95.9s in single noisy sample)
+ src/prefect/_internal/concurrency/calls.py:273: error: Unused "type: ignore" comment [unused-ignore]
mkdocs (https://github.com/mkdocs/mkdocs)
+ mkdocs/utils/templates.py:47: error: Subclass of "ExtraScriptValue" and "str" cannot exist: would have incompatible method signatures [unreachable]
mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ bson/regex.py:112: error: Unused "type: ignore" comment [unused-ignore]
pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/arrays/base.py:2207: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/generic.py:1868: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/indexes/base.py:5209: error: Unused "type: ignore" comment [unused-ignore]
asynq (https://github.com/quora/asynq)
+ asynq/tests/test_tools.py:183: error: Unused "type: ignore" comment [unused-ignore]
schema_salad (https://github.com/common-workflow-language/schema_salad)
+ schema_salad/jsonld_context.py: note: In function "pred":
+ schema_salad/jsonld_context.py:53:31: error: Subclass of "str" and "MutableMapping[Any, Any]" cannot exist: would have incompatible method signatures [unreachable]
+ schema_salad/jsonld_context.py:54:21: error: Statement is unreachable [unreachable]
+ schema_salad/schema.py: note: In function "get_anon_name":
+ schema_salad/schema.py:422:27: error: Subclass of "str" and "Mapping[Any, Any]" cannot exist: would have incompatible method signatures [unreachable]
+ schema_salad/schema.py:423:17: error: Statement is unreachable [unreachable]
jax (https://github.com/google/jax)
+ jax/_src/core.py:523: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/core.py:811: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/earray.py:33: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/prng.py:300: error: Unused "type: ignore" comment [unused-ignore]
+ jax/experimental/sparse/_base.py:34: error: Unused "type: ignore" comment [unused-ignore]
pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/python_api.py:88: error: Unused "type: ignore" comment [unused-ignore]
+ src/_pytest/_code/source.py:50: error: Unused "type: ignore" comment [unused-ignore]
+ src/_pytest/_code/code.py:77: error: Unused "type: ignore" comment [unused-ignore]
werkzeug (https://github.com/pallets/werkzeug)
+ src/werkzeug/datastructures/structures.py:648: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/datastructures/headers.py:108: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/routing/rules.py:912: error: Unused "type: ignore" comment [unused-ignore]
static-frame (https://github.com/static-frame/static-frame)
+ static_frame/core/series.py:3170: error: Incompatible return value type (got "IndexBase", expected "TLabel | ndarray[Any, Any]") [return-value]
+ static_frame/core/frame.py:6688: error: Argument 1 to "index_from_optional_constructors" has incompatible type "TypeBlocks"; expected "TIndexInitializer" [arg-type]
+ static_frame/core/frame.py:6688: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:6688: note: Expected:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:6688: note: Got:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6688: note: Expected:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:6688: note: Got:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6688: note: Expected:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:6688: note: Got:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6688: note: Expected:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:6688: note: Got:
+ static_frame/core/frame.py:6688: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6914: error: Argument 1 to "index_from_optional_constructors" has incompatible type "TypeBlocks"; expected "TIndexInitializer" [arg-type]
+ static_frame/core/frame.py:6914: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:6914: note: Expected:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:6914: note: Got:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6914: note: Expected:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:6914: note: Got:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6914: note: Expected:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:6914: note: Got:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:6914: note: Expected:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:6914: note: Got:
+ static_frame/core/frame.py:6914: note: def __iter__(self) -> Iterator[TypeBlocks]
pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ pandas-stubs/core/generic.pyi:67: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/frame.pyi:312: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/indexes/base.pyi:72: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/groupby/generic.pyi:167: error: Return type "Iterator[tuple[ByT, Series[S1]]]" of "__iter__" incompatible with return type "Iterator[tuple[Hashable, Series[S1]]]" in supertype "BaseGroupBy" [override]
+ pandas-stubs/core/groupby/generic.pyi:378: error: Return type "Iterator[tuple[ByT, DataFrame]]" of "__iter__" incompatible with return type "Iterator[tuple[Hashable, DataFrame]]" in supertype "BaseGroupBy" [override]
beartype (https://github.com/beartype/beartype): 1.54x faster (17.3s -> 11.3s in single noisy sample)
+ beartype/_check/metadata/metadecor.py:249: error: Unused "type: ignore" comment [unused-ignore]
+ beartype/_check/metadata/metacheck.py:97: error: Unused "type: ignore" comment [unused-ignore]
xarray (https://github.com/pydata/xarray)
+ xarray/core/_typed_ops.py:93: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:362: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:736: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1164: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1376: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1502: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataset.py:1430: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataset.py: note: In class "Dataset":
+ xarray/core/dataset.py:1430: error: Cannot override instance variable (previously declared on base class "DatasetOpsMixin") with class variable [misc]
+ xarray/core/dataset.py:1430: note: Error code "misc" not covered by "type: ignore" comment
+ xarray/core/dataset.py: note: At top level:
+ xarray/core/dataarray.py:1312: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataarray.py: note: In member "rename" of class "DataArray":
+ xarray/core/dataarray.py:2549: error: Argument "name" to "_replace" of "DataArray" has incompatible type "Hashable | Mapping[Any, Hashable]"; expected "Hashable | Default | None" [arg-type]
+ xarray/core/dataarray.py: note: At top level:
+ xarray/core/datatree.py:301: error: Unused "type: ignore" comment [unused-ignore]
Diff from mypy_primer, showing the effect of this PR on open source code:
prefect (https://github.com/PrefectHQ/prefect)
+ src/prefect/_internal/concurrency/calls.py:273: error: Unused "type: ignore" comment [unused-ignore]
mkdocs (https://github.com/mkdocs/mkdocs)
+ mkdocs/utils/templates.py:47: error: Subclass of "ExtraScriptValue" and "str" cannot exist: would have incompatible method signatures [unreachable]
mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ bson/regex.py:112: error: Unused "type: ignore" comment [unused-ignore]
pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/arrays/base.py:2207: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/generic.py:1868: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/indexes/base.py:5209: error: Unused "type: ignore" comment [unused-ignore]
asynq (https://github.com/quora/asynq)
+ asynq/tests/test_tools.py:183: error: Unused "type: ignore" comment [unused-ignore]
schema_salad (https://github.com/common-workflow-language/schema_salad)
+ schema_salad/jsonld_context.py: note: In function "pred":
+ schema_salad/jsonld_context.py:53:31: error: Subclass of "str" and "MutableMapping[Any, Any]" cannot exist: would have incompatible method signatures [unreachable]
+ schema_salad/jsonld_context.py:54:21: error: Statement is unreachable [unreachable]
+ schema_salad/schema.py: note: In function "get_anon_name":
+ schema_salad/schema.py:422:27: error: Subclass of "str" and "Mapping[Any, Any]" cannot exist: would have incompatible method signatures [unreachable]
+ schema_salad/schema.py:423:17: error: Statement is unreachable [unreachable]
jax (https://github.com/google/jax)
+ jax/_src/core.py:495: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/core.py:783: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/earray.py:33: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/prng.py:300: error: Unused "type: ignore" comment [unused-ignore]
+ jax/experimental/sparse/_base.py:34: error: Unused "type: ignore" comment [unused-ignore]
pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/python_api.py:88: error: Unused "type: ignore" comment [unused-ignore]
+ src/_pytest/_code/source.py:50: error: Unused "type: ignore" comment [unused-ignore]
+ src/_pytest/_code/code.py:77: error: Unused "type: ignore" comment [unused-ignore]
werkzeug (https://github.com/pallets/werkzeug)
+ src/werkzeug/datastructures/structures.py:648: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/datastructures/headers.py:108: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/routing/rules.py:912: error: Unused "type: ignore" comment [unused-ignore]
static-frame (https://github.com/static-frame/static-frame)
+ static_frame/core/series.py:3346: error: Incompatible return value type (got "IndexBase", expected "TLabel | ndarray[Any, Any]") [return-value]
+ static_frame/core/frame.py:7056: error: Argument 1 to "index_from_optional_constructors" has incompatible type "TypeBlocks"; expected "TIndexInitializer" [arg-type]
+ static_frame/core/frame.py:7056: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:7056: note: Expected:
+ static_frame/core/frame.py:7056: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:7056: note: Got:
+ static_frame/core/frame.py:7056: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:7056: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:7056: note: Expected:
+ static_frame/core/frame.py:7056: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:7056: note: Got:
+ static_frame/core/frame.py:7056: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:7298: error: Argument 1 to "index_from_optional_constructors" has incompatible type "TypeBlocks"; expected "TIndexInitializer" [arg-type]
+ static_frame/core/frame.py:7298: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:7298: note: Expected:
+ static_frame/core/frame.py:7298: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:7298: note: Got:
+ static_frame/core/frame.py:7298: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:7298: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:7298: note: Expected:
+ static_frame/core/frame.py:7298: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:7298: note: Got:
+ static_frame/core/frame.py:7298: note: def __iter__(self) -> Iterator[TypeBlocks]
pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ pandas-stubs/core/generic.pyi:68: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/frame.pyi:313: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/indexes/base.pyi:71: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/groupby/generic.pyi:167: error: Return type "Iterator[tuple[ByT, Series[S1]]]" of "__iter__" incompatible with return type "Iterator[tuple[Hashable, Series[S1]]]" in supertype "pandas.core.groupby.groupby.BaseGroupBy" [override]
+ pandas-stubs/core/groupby/generic.pyi:378: error: Return type "Iterator[tuple[ByT, DataFrame]]" of "__iter__" incompatible with return type "Iterator[tuple[Hashable, DataFrame]]" in supertype "pandas.core.groupby.groupby.BaseGroupBy" [override]
beartype (https://github.com/beartype/beartype)
+ beartype/_check/metadata/metadecor.py:249: error: Unused "type: ignore" comment [unused-ignore]
+ beartype/_check/metadata/metacheck.py:97: error: Unused "type: ignore" comment [unused-ignore]
xarray (https://github.com/pydata/xarray)
+ xarray/core/_typed_ops.py:93: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:362: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:736: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1164: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1376: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1502: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataset.py:1430: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataset.py: note: In class "Dataset":
+ xarray/core/dataset.py:1430: error: Cannot override instance variable (previously declared on base class "DatasetOpsMixin") with class variable [misc]
+ xarray/core/dataset.py:1430: note: Error code "misc" not covered by "type: ignore" comment
+ xarray/core/dataset.py: note: At top level:
+ xarray/core/dataarray.py:1312: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataarray.py: note: In member "rename" of class "DataArray":
+ xarray/core/dataarray.py:2549: error: Argument "name" to "_replace" of "DataArray" has incompatible type "Hashable | Mapping[Any, Hashable]"; expected "Hashable | Default | None" [arg-type]
+ xarray/core/dataarray.py: note: At top level:
+ xarray/core/datatree.py:301: error: Unused "type: ignore" comment [unused-ignore]
Diff from mypy_primer, showing the effect of this PR on open source code:
mkdocs (https://github.com/mkdocs/mkdocs)
+ mkdocs/utils/templates.py:47: error: Subclass of "ExtraScriptValue" and "str" cannot exist: would have incompatible method signatures [unreachable]
ibis (https://github.com/ibis-project/ibis)
- ibis/common/bases.py:167: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/common/bases.py:205: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/common/bases.py:249: error: Signature of "__hash__" incompatible with supertype "Slotted" [override]
- ibis/common/bases.py:249: note: Superclass:
- ibis/common/bases.py:249: note: None
- ibis/common/bases.py:249: note: Subclass:
- ibis/common/bases.py:249: note: def __hash__(self) -> int
- ibis/common/collections.py:153: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/common/collections.py:291: error: Signature of "__hash__" incompatible with supertype "Mapping" [override]
- ibis/common/collections.py:291: note: Superclass:
- ibis/common/collections.py:291: note: None
- ibis/common/collections.py:291: note: Subclass:
- ibis/common/collections.py:291: note: def __hash__(self) -> int
- ibis/common/collections.py:313: note: Superclass:
- ibis/common/collections.py:313: note: None
- ibis/common/collections.py:313: note: Subclass:
- ibis/common/collections.py:313: note: def __hash__(self) -> int
- ibis/common/collections.py:313: error: Signature of "__hash__" incompatible with supertype "Mapping" [override]
- ibis/common/deferred.py:180: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/common/patterns.py:660: error: Signature of "__hash__" incompatible with supertype "Slotted" [override]
- ibis/common/patterns.py:660: note: Superclass:
- ibis/common/patterns.py:660: note: None
- ibis/common/patterns.py:660: note: Subclass:
- ibis/common/patterns.py:660: note: def __hash__(self) -> int
- ibis/common/patterns.py:937: error: Signature of "__hash__" incompatible with supertype "Slotted" [override]
- ibis/common/patterns.py:937: note: Superclass:
- ibis/common/patterns.py:937: note: None
- ibis/common/patterns.py:937: note: Subclass:
- ibis/common/patterns.py:937: note: def __hash__(self) -> int
- ibis/common/grounds.py:164: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/common/grounds.py:220: error: Signature of "__hash__" incompatible with supertype "Comparable" [override]
- ibis/common/grounds.py:220: note: Superclass:
- ibis/common/grounds.py:220: note: None
- ibis/common/grounds.py:220: note: Subclass:
- ibis/common/grounds.py:220: note: def __hash__(self) -> int
- ibis/common/grounds.py:220: error: Signature of "__hash__" incompatible with supertype "Annotable" [override]
- ibis/common/grounds.py:220: note: Superclass:
- ibis/common/grounds.py:220: note: None
- ibis/common/grounds.py:220: note: Subclass:
- ibis/common/grounds.py:220: note: def __hash__(self) -> int
- ibis/common/egraph.py:124: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/expr/datatypes/core.py:932: error: Definition of "__hash__" in base class "Concrete" is incompatible with definition in base class "Mapping" [misc]
- ibis/expr/schema.py:25: error: Definition of "__hash__" in base class "Concrete" is incompatible with definition in base class "Mapping" [misc]
- ibis/common/tests/test_grounds.py:142: error: Definition of "__hash__" in base class "Concrete" is incompatible with definition in base class "Mapping" [misc]
mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ bson/regex.py:112: error: Unused "type: ignore" comment [unused-ignore]
pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/arrays/base.py:2207: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/generic.py:1868: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/indexes/base.py:5209: error: Unused "type: ignore" comment [unused-ignore]
prefect (https://github.com/PrefectHQ/prefect)
+ src/prefect/_internal/concurrency/calls.py:273: error: Unused "type: ignore" comment [unused-ignore]
asynq (https://github.com/quora/asynq)
+ asynq/tests/test_tools.py:183: error: Unused "type: ignore" comment [unused-ignore]
schema_salad (https://github.com/common-workflow-language/schema_salad)
+ schema_salad/jsonld_context.py: note: In function "pred":
+ schema_salad/jsonld_context.py:53:31: error: Subclass of "str" and "MutableMapping[Any, Any]" cannot exist: would have incompatible method signatures [unreachable]
+ schema_salad/jsonld_context.py:54:21: error: Statement is unreachable [unreachable]
+ schema_salad/schema.py: note: In function "get_anon_name":
+ schema_salad/schema.py:422:27: error: Subclass of "str" and "Mapping[Any, Any]" cannot exist: would have incompatible method signatures [unreachable]
+ schema_salad/schema.py:423:17: error: Statement is unreachable [unreachable]
jax (https://github.com/google/jax)
+ jax/_src/core.py:515: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/core.py:803: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/earray.py:33: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/prng.py:300: error: Unused "type: ignore" comment [unused-ignore]
+ jax/experimental/sparse/_base.py:34: error: Unused "type: ignore" comment [unused-ignore]
werkzeug (https://github.com/pallets/werkzeug)
+ src/werkzeug/datastructures/structures.py:648: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/datastructures/headers.py:108: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/routing/rules.py:912: error: Unused "type: ignore" comment [unused-ignore]
pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/python_api.py:88: error: Unused "type: ignore" comment [unused-ignore]
+ src/_pytest/_code/source.py:50: error: Unused "type: ignore" comment [unused-ignore]
+ src/_pytest/_code/code.py:77: error: Unused "type: ignore" comment [unused-ignore]
static-frame (https://github.com/static-frame/static-frame)
+ static_frame/core/series.py:3346: error: Incompatible return value type (got "IndexBase", expected "TLabel | ndarray[Any, Any]") [return-value]
+ static_frame/core/frame.py:7056: error: Argument 1 to "index_from_optional_constructors" has incompatible type "TypeBlocks"; expected "TIndexInitializer" [arg-type]
+ static_frame/core/frame.py:7056: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:7056: note: Expected:
+ static_frame/core/frame.py:7056: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:7056: note: Got:
+ static_frame/core/frame.py:7056: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:7056: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:7056: note: Expected:
+ static_frame/core/frame.py:7056: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:7056: note: Got:
+ static_frame/core/frame.py:7056: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:7298: error: Argument 1 to "index_from_optional_constructors" has incompatible type "TypeBlocks"; expected "TIndexInitializer" [arg-type]
+ static_frame/core/frame.py:7298: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:7298: note: Expected:
+ static_frame/core/frame.py:7298: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:7298: note: Got:
+ static_frame/core/frame.py:7298: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:7298: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:7298: note: Expected:
+ static_frame/core/frame.py:7298: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:7298: note: Got:
+ static_frame/core/frame.py:7298: note: def __iter__(self) -> Iterator[TypeBlocks]
pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ pandas-stubs/core/generic.pyi:68: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/frame.pyi:312: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/indexes/base.pyi:70: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/groupby/generic.pyi:205: error: Return type "Iterator[tuple[ByT, Series[S2]]]" of "__iter__" incompatible with return type "Iterator[tuple[Hashable, Series[S2]]]" in supertype "pandas.core.groupby.groupby.BaseGroupBy" [override]
+ pandas-stubs/core/groupby/generic.pyi:428: error: Return type "Iterator[tuple[ByT, DataFrame]]" of "__iter__" incompatible with return type "Iterator[tuple[Hashable, DataFrame]]" in supertype "pandas.core.groupby.groupby.BaseGroupBy" [override]
beartype (https://github.com/beartype/beartype)
+ beartype/_check/metadata/metadecor.py:249: error: Unused "type: ignore" comment [unused-ignore]
+ beartype/_check/metadata/metacheck.py:97: error: Unused "type: ignore" comment [unused-ignore]
xarray (https://github.com/pydata/xarray)
+ xarray/core/_typed_ops.py:93: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:362: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:736: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1164: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1376: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1502: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataset.py:1431: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataset.py: note: In class "Dataset":
+ xarray/core/dataset.py:1431: error: Cannot override instance variable (previously declared on base class "DatasetOpsMixin") with class variable [misc]
+ xarray/core/dataset.py:1431: note: Error code "misc" not covered by "type: ignore" comment
+ xarray/core/dataset.py: note: At top level:
+ xarray/core/dataarray.py:1312: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataarray.py: note: In member "rename" of class "DataArray":
+ xarray/core/dataarray.py:2549: error: Argument "name" to "_replace" of "DataArray" has incompatible type "Hashable | Mapping[Any, Hashable]"; expected "Hashable | Default | None" [arg-type]
+ xarray/core/dataarray.py: note: At top level:
+ xarray/core/datatree.py:301: error: Unused "type: ignore" comment [unused-ignore]
-
xarrayshould either always use__hash__ = Noneor__hash__: ClassVar[None]. Using__hash__: Noneeverywhere should also work, I suppose, but doesn't have proper semantics. All errors are correct, and "cannot override instance variable..." will be fixed by usingClassVar[None]everywhere. Another one (argument "name"...) is a true positive, Mapping is notHashable, the call should be rejected. - pandas:
ByTis not hashable because its memberPeriodis not. And it's a bug, at runtimePeriodis hashable, they're simply missing a__hash__definition on it. If we can contact pandas-stubs maintainers, would be nice to let them know. - I'm lost in
static_frame, this seems reasonable, there's also pyright-ignore on that line, but I'm failing to trace precise types in a 10 KLOC file (and not even self-contained in that file). - All other primer hits are correct; noticing that
strandMapping/MutableMappingare incompatible is also a great outcome.
Diff from mypy_primer, showing the effect of this PR on open source code:
mkdocs (https://github.com/mkdocs/mkdocs)
+ mkdocs/utils/templates.py:47: error: Subclass of "ExtraScriptValue" and "str" cannot exist: would have incompatible method signatures [unreachable]
mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ bson/regex.py:112: error: Unused "type: ignore" comment [unused-ignore]
pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/arrays/base.py:2207: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/generic.py:1868: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/indexes/base.py:5209: error: Unused "type: ignore" comment [unused-ignore]
prefect (https://github.com/PrefectHQ/prefect)
+ src/prefect/_internal/concurrency/calls.py:273: error: Unused "type: ignore" comment [unused-ignore]
ibis (https://github.com/ibis-project/ibis)
- ibis/common/bases.py:167: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/common/bases.py:205: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/common/bases.py:249: error: Signature of "__hash__" incompatible with supertype "Slotted" [override]
- ibis/common/bases.py:249: note: Superclass:
- ibis/common/bases.py:249: note: None
- ibis/common/bases.py:249: note: Subclass:
- ibis/common/bases.py:249: note: def __hash__(self) -> int
- ibis/common/collections.py:153: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/common/collections.py:291: error: Signature of "__hash__" incompatible with supertype "Mapping" [override]
- ibis/common/collections.py:291: note: Superclass:
- ibis/common/collections.py:291: note: None
- ibis/common/collections.py:291: note: Subclass:
- ibis/common/collections.py:291: note: def __hash__(self) -> int
- ibis/common/collections.py:313: note: Superclass:
- ibis/common/collections.py:313: note: None
- ibis/common/collections.py:313: note: Subclass:
- ibis/common/collections.py:313: note: def __hash__(self) -> int
- ibis/common/collections.py:313: error: Signature of "__hash__" incompatible with supertype "Mapping" [override]
- ibis/common/deferred.py:180: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/common/patterns.py:660: error: Signature of "__hash__" incompatible with supertype "Slotted" [override]
- ibis/common/patterns.py:660: note: Superclass:
- ibis/common/patterns.py:660: note: None
- ibis/common/patterns.py:660: note: Subclass:
- ibis/common/patterns.py:660: note: def __hash__(self) -> int
- ibis/common/patterns.py:937: error: Signature of "__hash__" incompatible with supertype "Slotted" [override]
- ibis/common/patterns.py:937: note: Superclass:
- ibis/common/patterns.py:937: note: None
- ibis/common/patterns.py:937: note: Subclass:
- ibis/common/patterns.py:937: note: def __hash__(self) -> int
- ibis/common/grounds.py:164: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/common/grounds.py:220: error: Signature of "__hash__" incompatible with supertype "Comparable" [override]
- ibis/common/grounds.py:220: note: Superclass:
- ibis/common/grounds.py:220: note: None
- ibis/common/grounds.py:220: note: Subclass:
- ibis/common/grounds.py:220: note: def __hash__(self) -> int
- ibis/common/grounds.py:220: error: Signature of "__hash__" incompatible with supertype "Annotable" [override]
- ibis/common/grounds.py:220: note: Superclass:
- ibis/common/grounds.py:220: note: None
- ibis/common/grounds.py:220: note: Subclass:
- ibis/common/grounds.py:220: note: def __hash__(self) -> int
- ibis/common/egraph.py:124: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/expr/datatypes/core.py:932: error: Definition of "__hash__" in base class "Concrete" is incompatible with definition in base class "Mapping" [misc]
- ibis/expr/schema.py:25: error: Definition of "__hash__" in base class "Concrete" is incompatible with definition in base class "Mapping" [misc]
- ibis/common/tests/test_grounds.py:142: error: Definition of "__hash__" in base class "Concrete" is incompatible with definition in base class "Mapping" [misc]
schema_salad (https://github.com/common-workflow-language/schema_salad)
+ schema_salad/jsonld_context.py: note: In function "pred":
+ schema_salad/jsonld_context.py:53:31: error: Subclass of "str" and "MutableMapping[Any, Any]" cannot exist: would have incompatible method signatures [unreachable]
+ schema_salad/jsonld_context.py:54:21: error: Statement is unreachable [unreachable]
+ schema_salad/schema.py: note: In function "get_anon_name":
+ schema_salad/schema.py:422:27: error: Subclass of "str" and "Mapping[Any, Any]" cannot exist: would have incompatible method signatures [unreachable]
+ schema_salad/schema.py:423:17: error: Statement is unreachable [unreachable]
jax (https://github.com/google/jax)
+ jax/_src/core.py:525: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/core.py:815: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/earray.py:33: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/prng.py:302: error: Unused "type: ignore" comment [unused-ignore]
+ jax/experimental/sparse/_base.py:34: error: Unused "type: ignore" comment [unused-ignore]
asynq (https://github.com/quora/asynq)
+ asynq/tests/test_tools.py:183: error: Unused "type: ignore" comment [unused-ignore]
pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/python_api.py:88: error: Unused "type: ignore" comment [unused-ignore]
+ src/_pytest/_code/source.py:50: error: Unused "type: ignore" comment [unused-ignore]
+ src/_pytest/_code/code.py:77: error: Unused "type: ignore" comment [unused-ignore]
werkzeug (https://github.com/pallets/werkzeug)
+ src/werkzeug/datastructures/structures.py:648: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/datastructures/headers.py:108: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/routing/rules.py:912: error: Unused "type: ignore" comment [unused-ignore]
static-frame (https://github.com/static-frame/static-frame)
+ static_frame/core/series.py:3346: error: Incompatible return value type (got "IndexBase", expected "TLabel | ndarray[Any, Any]") [return-value]
+ static_frame/core/frame.py:7056: error: Argument 1 to "index_from_optional_constructors" has incompatible type "TypeBlocks"; expected "TIndexInitializer" [arg-type]
+ static_frame/core/frame.py:7056: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:7056: note: Expected:
+ static_frame/core/frame.py:7056: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:7056: note: Got:
+ static_frame/core/frame.py:7056: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:7056: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:7056: note: Expected:
+ static_frame/core/frame.py:7056: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:7056: note: Got:
+ static_frame/core/frame.py:7056: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:7298: error: Argument 1 to "index_from_optional_constructors" has incompatible type "TypeBlocks"; expected "TIndexInitializer" [arg-type]
+ static_frame/core/frame.py:7298: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:7298: note: Expected:
+ static_frame/core/frame.py:7298: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:7298: note: Got:
+ static_frame/core/frame.py:7298: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:7298: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:7298: note: Expected:
+ static_frame/core/frame.py:7298: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:7298: note: Got:
+ static_frame/core/frame.py:7298: note: def __iter__(self) -> Iterator[TypeBlocks]
pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ pandas-stubs/core/generic.pyi:68: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/frame.pyi:312: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/indexes/base.pyi:70: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/groupby/generic.pyi:206: error: Return type "Iterator[tuple[ByT, Series[S2]]]" of "__iter__" incompatible with return type "Iterator[tuple[Hashable, Series[S2]]]" in supertype "pandas.core.groupby.groupby.BaseGroupBy" [override]
+ pandas-stubs/core/groupby/generic.pyi:446: error: Return type "Iterator[tuple[ByT, DataFrame]]" of "__iter__" incompatible with return type "Iterator[tuple[Hashable, DataFrame]]" in supertype "pandas.core.groupby.groupby.BaseGroupBy" [override]
beartype (https://github.com/beartype/beartype)
+ beartype/_check/metadata/metadecor.py:249: error: Unused "type: ignore" comment [unused-ignore]
+ beartype/_check/metadata/metacheck.py:97: error: Unused "type: ignore" comment [unused-ignore]
xarray (https://github.com/pydata/xarray)
+ xarray/core/_typed_ops.py:93: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:362: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:736: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1164: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1376: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1502: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataset.py:1430: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataset.py: note: In class "Dataset":
+ xarray/core/dataset.py:1430: error: Cannot override instance variable (previously declared on base class "DatasetOpsMixin") with class variable [misc]
+ xarray/core/dataset.py:1430: note: Error code "misc" not covered by "type: ignore" comment
+ xarray/core/dataset.py: note: At top level:
+ xarray/core/dataarray.py:1312: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataarray.py: note: In member "rename" of class "DataArray":
+ xarray/core/dataarray.py:2549: error: Argument "name" to "_replace" of "DataArray" has incompatible type "Hashable | Mapping[Any, Hashable]"; expected "Hashable | Default | None" [arg-type]
+ xarray/core/dataarray.py: note: At top level:
+ xarray/core/datatree.py:301: error: Unused "type: ignore" comment [unused-ignore]
Diff from mypy_primer, showing the effect of this PR on open source code:
schema_salad (https://github.com/common-workflow-language/schema_salad)
+ schema_salad/jsonld_context.py: note: In function "pred":
+ schema_salad/jsonld_context.py:53:31: error: Subclass of "str" and "MutableMapping[Any, Any]" cannot exist: would have incompatible method signatures [unreachable]
+ schema_salad/jsonld_context.py:54:21: error: Statement is unreachable [unreachable]
+ schema_salad/schema.py: note: In function "get_anon_name":
+ schema_salad/schema.py:422:27: error: Subclass of "str" and "Mapping[Any, Any]" cannot exist: would have incompatible method signatures [unreachable]
+ schema_salad/schema.py:423:17: error: Statement is unreachable [unreachable]
static-frame (https://github.com/static-frame/static-frame)
+ static_frame/core/series.py:3346: error: Incompatible return value type (got "IndexBase", expected "TLabel | ndarray[Any, Any]") [return-value]
+ static_frame/core/frame.py:7056: error: Argument 1 to "index_from_optional_constructors" has incompatible type "TypeBlocks"; expected "TIndexInitializer" [arg-type]
+ static_frame/core/frame.py:7056: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:7056: note: Expected:
+ static_frame/core/frame.py:7056: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:7056: note: Got:
+ static_frame/core/frame.py:7056: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:7056: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:7056: note: Expected:
+ static_frame/core/frame.py:7056: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:7056: note: Got:
+ static_frame/core/frame.py:7056: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:7298: error: Argument 1 to "index_from_optional_constructors" has incompatible type "TypeBlocks"; expected "TIndexInitializer" [arg-type]
+ static_frame/core/frame.py:7298: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:7298: note: Expected:
+ static_frame/core/frame.py:7298: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:7298: note: Got:
+ static_frame/core/frame.py:7298: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:7298: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:7298: note: Expected:
+ static_frame/core/frame.py:7298: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:7298: note: Got:
+ static_frame/core/frame.py:7298: note: def __iter__(self) -> Iterator[TypeBlocks]
pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/arrays/base.py:2207: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/generic.py:1867: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/indexes/base.py:5209: error: Unused "type: ignore" comment [unused-ignore]
asynq (https://github.com/quora/asynq)
+ asynq/tests/test_tools.py:183: error: Unused "type: ignore" comment [unused-ignore]
jax (https://github.com/google/jax)
+ jax/_src/core.py:525: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/core.py:837: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/earray.py:33: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/prng.py:302: error: Unused "type: ignore" comment [unused-ignore]
+ jax/experimental/sparse/_base.py:34: error: Unused "type: ignore" comment [unused-ignore]
werkzeug (https://github.com/pallets/werkzeug)
+ src/werkzeug/datastructures/structures.py:648: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/datastructures/headers.py:108: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/routing/rules.py:912: error: Unused "type: ignore" comment [unused-ignore]
prefect (https://github.com/PrefectHQ/prefect)
+ src/prefect/_internal/concurrency/calls.py:273: error: Unused "type: ignore" comment [unused-ignore]
mkdocs (https://github.com/mkdocs/mkdocs)
+ mkdocs/utils/templates.py:47: error: Subclass of "ExtraScriptValue" and "str" cannot exist: would have incompatible method signatures [unreachable]
pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ pandas-stubs/core/generic.pyi:68: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/frame.pyi:312: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/indexes/base.pyi:70: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/groupby/generic.pyi:206: error: Return type "Iterator[tuple[ByT, Series[S2]]]" of "__iter__" incompatible with return type "Iterator[tuple[Hashable, Series[S2]]]" in supertype "pandas.core.groupby.groupby.BaseGroupBy" [override]
+ pandas-stubs/core/groupby/generic.pyi:446: error: Return type "Iterator[tuple[ByT, DataFrame]]" of "__iter__" incompatible with return type "Iterator[tuple[Hashable, DataFrame]]" in supertype "pandas.core.groupby.groupby.BaseGroupBy" [override]
pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/python_api.py:88: error: Unused "type: ignore" comment [unused-ignore]
+ src/_pytest/_code/source.py:50: error: Unused "type: ignore" comment [unused-ignore]
+ src/_pytest/_code/code.py:77: error: Unused "type: ignore" comment [unused-ignore]
xarray (https://github.com/pydata/xarray)
+ xarray/core/_typed_ops.py:93: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:362: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:736: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1164: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1376: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1502: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataset.py:1430: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataset.py: note: In class "Dataset":
+ xarray/core/dataset.py:1430: error: Cannot override instance variable (previously declared on base class "DatasetOpsMixin") with class variable [misc]
+ xarray/core/dataset.py:1430: note: Error code "misc" not covered by "type: ignore" comment
+ xarray/core/dataset.py: note: At top level:
+ xarray/core/dataarray.py:1312: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataarray.py: note: In member "rename" of class "DataArray":
+ xarray/core/dataarray.py:2549: error: Argument "name" to "_replace" of "DataArray" has incompatible type "Hashable | Mapping[Any, Hashable]"; expected "Hashable | Default | None" [arg-type]
+ xarray/core/dataarray.py: note: At top level:
+ xarray/core/datatree.py:301: error: Unused "type: ignore" comment [unused-ignore]
beartype (https://github.com/beartype/beartype)
+ beartype/_check/metadata/metadecor.py:289: error: Unused "type: ignore" comment [unused-ignore]
+ beartype/_check/metadata/metacheck.py:97: error: Unused "type: ignore" comment [unused-ignore]
mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ bson/regex.py:112: error: Unused "type: ignore" comment [unused-ignore]
ibis (https://github.com/ibis-project/ibis)
- ibis/common/bases.py:167: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/common/bases.py:205: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/common/bases.py:249: error: Signature of "__hash__" incompatible with supertype "Slotted" [override]
- ibis/common/bases.py:249: note: Superclass:
- ibis/common/bases.py:249: note: None
- ibis/common/bases.py:249: note: Subclass:
- ibis/common/bases.py:249: note: def __hash__(self) -> int
- ibis/common/collections.py:153: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/common/collections.py:291: error: Signature of "__hash__" incompatible with supertype "Mapping" [override]
- ibis/common/collections.py:291: note: Superclass:
- ibis/common/collections.py:291: note: None
- ibis/common/collections.py:291: note: Subclass:
- ibis/common/collections.py:291: note: def __hash__(self) -> int
- ibis/common/collections.py:313: note: Superclass:
- ibis/common/collections.py:313: note: None
- ibis/common/collections.py:313: note: Subclass:
- ibis/common/collections.py:313: note: def __hash__(self) -> int
- ibis/common/collections.py:313: error: Signature of "__hash__" incompatible with supertype "Mapping" [override]
- ibis/common/deferred.py:180: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/common/patterns.py:660: error: Signature of "__hash__" incompatible with supertype "Slotted" [override]
- ibis/common/patterns.py:660: note: Superclass:
- ibis/common/patterns.py:660: note: None
- ibis/common/patterns.py:660: note: Subclass:
- ibis/common/patterns.py:660: note: def __hash__(self) -> int
- ibis/common/patterns.py:937: error: Signature of "__hash__" incompatible with supertype "Slotted" [override]
- ibis/common/patterns.py:937: note: Superclass:
- ibis/common/patterns.py:937: note: None
- ibis/common/patterns.py:937: note: Subclass:
- ibis/common/patterns.py:937: note: def __hash__(self) -> int
- ibis/common/grounds.py:164: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/common/grounds.py:220: error: Signature of "__hash__" incompatible with supertype "Comparable" [override]
- ibis/common/grounds.py:220: note: Superclass:
- ibis/common/grounds.py:220: note: None
- ibis/common/grounds.py:220: note: Subclass:
- ibis/common/grounds.py:220: note: def __hash__(self) -> int
- ibis/common/grounds.py:220: error: Signature of "__hash__" incompatible with supertype "Annotable" [override]
- ibis/common/grounds.py:220: note: Superclass:
- ibis/common/grounds.py:220: note: None
- ibis/common/grounds.py:220: note: Subclass:
- ibis/common/grounds.py:220: note: def __hash__(self) -> int
- ibis/common/egraph.py:124: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/expr/datatypes/core.py:932: error: Definition of "__hash__" in base class "Concrete" is incompatible with definition in base class "Mapping" [misc]
- ibis/expr/schema.py:25: error: Definition of "__hash__" in base class "Concrete" is incompatible with definition in base class "Mapping" [misc]
- ibis/common/tests/test_grounds.py:142: error: Definition of "__hash__" in base class "Concrete" is incompatible with definition in base class "Mapping" [misc]
Diff from mypy_primer, showing the effect of this PR on open source code:
colour (https://github.com/colour-science/colour)
- colour/utilities/structures.py:515: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- colour/io/luts/sequence.py:266: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- colour/io/luts/operator.py:411: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- colour/io/luts/lut.py:354: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
schema_salad (https://github.com/common-workflow-language/schema_salad)
+ schema_salad/jsonld_context.py: note: In function "pred":
+ schema_salad/jsonld_context.py:53:31: error: Subclass of "str" and "MutableMapping[Any, Any]" cannot exist: would have incompatible method signatures [unreachable]
+ schema_salad/jsonld_context.py:54:21: error: Statement is unreachable [unreachable]
+ schema_salad/schema.py: note: In function "get_anon_name":
+ schema_salad/schema.py:422:27: error: Subclass of "str" and "Mapping[Any, Any]" cannot exist: would have incompatible method signatures [unreachable]
+ schema_salad/schema.py:423:17: error: Statement is unreachable [unreachable]
pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/arrays/base.py:2207: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/generic.py:1867: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/indexes/base.py:5204: error: Unused "type: ignore" comment [unused-ignore]
static-frame (https://github.com/static-frame/static-frame)
+ static_frame/core/series.py:3346: error: Incompatible return value type (got "IndexBase", expected "TLabel | ndarray[Any, Any]") [return-value]
+ static_frame/core/frame.py:7056: error: Argument 1 to "index_from_optional_constructors" has incompatible type "TypeBlocks"; expected "TIndexInitializer" [arg-type]
+ static_frame/core/frame.py:7056: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:7056: note: Expected:
+ static_frame/core/frame.py:7056: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:7056: note: Got:
+ static_frame/core/frame.py:7056: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:7056: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:7056: note: Expected:
+ static_frame/core/frame.py:7056: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:7056: note: Got:
+ static_frame/core/frame.py:7056: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:7298: error: Argument 1 to "index_from_optional_constructors" has incompatible type "TypeBlocks"; expected "TIndexInitializer" [arg-type]
+ static_frame/core/frame.py:7298: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:7298: note: Expected:
+ static_frame/core/frame.py:7298: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:7298: note: Got:
+ static_frame/core/frame.py:7298: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:7298: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:7298: note: Expected:
+ static_frame/core/frame.py:7298: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:7298: note: Got:
+ static_frame/core/frame.py:7298: note: def __iter__(self) -> Iterator[TypeBlocks]
asynq (https://github.com/quora/asynq)
+ asynq/tests/test_tools.py:183: error: Unused "type: ignore" comment [unused-ignore]
jax (https://github.com/google/jax)
+ jax/_src/core.py:529: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/core.py:870: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/earray.py:33: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/prng.py:302: error: Unused "type: ignore" comment [unused-ignore]
+ jax/experimental/sparse/_base.py:34: error: Unused "type: ignore" comment [unused-ignore]
werkzeug (https://github.com/pallets/werkzeug)
+ src/werkzeug/datastructures/structures.py:648: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/datastructures/headers.py:108: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/routing/rules.py:912: error: Unused "type: ignore" comment [unused-ignore]
pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ pandas-stubs/core/generic.pyi:68: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/frame.pyi:328: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/indexes/base.pyi:71: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/groupby/generic.pyi:206: error: Return type "Iterator[tuple[ByT, Series[S2]]]" of "__iter__" incompatible with return type "Iterator[tuple[Hashable, Series[S2]]]" in supertype "pandas.core.groupby.groupby.BaseGroupBy" [override]
+ pandas-stubs/core/groupby/generic.pyi:446: error: Return type "Iterator[tuple[ByT, DataFrame]]" of "__iter__" incompatible with return type "Iterator[tuple[Hashable, DataFrame]]" in supertype "pandas.core.groupby.groupby.BaseGroupBy" [override]
prefect (https://github.com/PrefectHQ/prefect)
+ src/prefect/_internal/concurrency/calls.py:273: error: Unused "type: ignore" comment [unused-ignore]
mkdocs (https://github.com/mkdocs/mkdocs)
+ mkdocs/utils/templates.py:47: error: Subclass of "ExtraScriptValue" and "str" cannot exist: would have incompatible method signatures [unreachable]
xarray (https://github.com/pydata/xarray)
+ xarray/core/_typed_ops.py:93: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:362: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:736: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1164: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1376: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1502: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataset.py:1436: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataset.py: note: In class "Dataset":
+ xarray/core/dataset.py:1436: error: Cannot override instance variable (previously declared on base class "DatasetOpsMixin") with class variable [misc]
+ xarray/core/dataset.py:1436: note: Error code "misc" not covered by "type: ignore" comment
+ xarray/core/dataset.py: note: At top level:
+ xarray/core/dataarray.py:1312: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataarray.py: note: In member "rename" of class "DataArray":
+ xarray/core/dataarray.py:2549: error: Argument "name" to "_replace" of "DataArray" has incompatible type "Hashable | Mapping[Any, Hashable]"; expected "Hashable | Default | None" [arg-type]
+ xarray/core/dataarray.py: note: At top level:
+ xarray/core/datatree.py:301: error: Unused "type: ignore" comment [unused-ignore]
pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/python_api.py:88: error: Unused "type: ignore" comment [unused-ignore]
+ src/_pytest/_code/source.py:50: error: Unused "type: ignore" comment [unused-ignore]
+ src/_pytest/_code/code.py:77: error: Unused "type: ignore" comment [unused-ignore]
beartype (https://github.com/beartype/beartype)
+ beartype/_check/metadata/metadecor.py:289: error: Unused "type: ignore" comment [unused-ignore]
+ beartype/_check/metadata/metacheck.py:97: error: Unused "type: ignore" comment [unused-ignore]
mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ bson/regex.py:112: error: Unused "type: ignore" comment [unused-ignore]
ibis (https://github.com/ibis-project/ibis)
- ibis/common/bases.py:167: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/common/bases.py:205: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/common/bases.py:249: error: Signature of "__hash__" incompatible with supertype "Slotted" [override]
- ibis/common/bases.py:249: note: Superclass:
- ibis/common/bases.py:249: note: None
- ibis/common/bases.py:249: note: Subclass:
- ibis/common/bases.py:249: note: def __hash__(self) -> int
- ibis/common/collections.py:153: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/common/collections.py:291: error: Signature of "__hash__" incompatible with supertype "Mapping" [override]
- ibis/common/collections.py:291: note: Superclass:
- ibis/common/collections.py:291: note: None
- ibis/common/collections.py:291: note: Subclass:
- ibis/common/collections.py:291: note: def __hash__(self) -> int
- ibis/common/collections.py:313: note: Superclass:
- ibis/common/collections.py:313: note: None
- ibis/common/collections.py:313: note: Subclass:
- ibis/common/collections.py:313: note: def __hash__(self) -> int
- ibis/common/collections.py:313: error: Signature of "__hash__" incompatible with supertype "Mapping" [override]
- ibis/common/deferred.py:180: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/common/patterns.py:660: error: Signature of "__hash__" incompatible with supertype "Slotted" [override]
- ibis/common/patterns.py:660: note: Superclass:
- ibis/common/patterns.py:660: note: None
- ibis/common/patterns.py:660: note: Subclass:
- ibis/common/patterns.py:660: note: def __hash__(self) -> int
- ibis/common/patterns.py:937: error: Signature of "__hash__" incompatible with supertype "Slotted" [override]
- ibis/common/patterns.py:937: note: Superclass:
- ibis/common/patterns.py:937: note: None
- ibis/common/patterns.py:937: note: Subclass:
- ibis/common/patterns.py:937: note: def __hash__(self) -> int
- ibis/common/grounds.py:164: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/common/grounds.py:220: error: Signature of "__hash__" incompatible with supertype "Comparable" [override]
- ibis/common/grounds.py:220: note: Superclass:
- ibis/common/grounds.py:220: note: None
- ibis/common/grounds.py:220: note: Subclass:
- ibis/common/grounds.py:220: note: def __hash__(self) -> int
- ibis/common/grounds.py:220: error: Signature of "__hash__" incompatible with supertype "Annotable" [override]
- ibis/common/grounds.py:220: note: Superclass:
- ibis/common/grounds.py:220: note: None
- ibis/common/grounds.py:220: note: Subclass:
- ibis/common/grounds.py:220: note: def __hash__(self) -> int
- ibis/common/egraph.py:124: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/expr/datatypes/core.py:941: error: Definition of "__hash__" in base class "Concrete" is incompatible with definition in base class "Mapping" [misc]
- ibis/expr/schema.py:25: error: Definition of "__hash__" in base class "Concrete" is incompatible with definition in base class "Mapping" [misc]
- ibis/common/tests/test_grounds.py:142: error: Definition of "__hash__" in base class "Concrete" is incompatible with definition in base class "Mapping" [misc]
Diff from mypy_primer, showing the effect of this PR on open source code:
beartype (https://github.com/beartype/beartype)
+ beartype/_check/metadata/metadecor.py:289: error: Unused "type: ignore" comment [unused-ignore]
+ beartype/_check/metadata/metacheck.py:97: error: Unused "type: ignore" comment [unused-ignore]
mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ bson/regex.py:112: error: Unused "type: ignore" comment [unused-ignore]
prefect (https://github.com/PrefectHQ/prefect)
+ src/prefect/_internal/concurrency/calls.py:273: error: Unused "type: ignore" comment [unused-ignore]
colour (https://github.com/colour-science/colour)
- colour/utilities/structures.py:515: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- colour/io/luts/sequence.py:266: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- colour/io/luts/operator.py:411: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- colour/io/luts/lut.py:354: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
asynq (https://github.com/quora/asynq)
+ asynq/tests/test_tools.py:183: error: Unused "type: ignore" comment [unused-ignore]
pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/python_api.py:88: error: Unused "type: ignore" comment [unused-ignore]
+ src/_pytest/_code/source.py:50: error: Unused "type: ignore" comment [unused-ignore]
+ src/_pytest/_code/code.py:77: error: Unused "type: ignore" comment [unused-ignore]
pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/arrays/base.py:2207: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/generic.py:1868: error: Unused "type: ignore" comment [unused-ignore]
+ pandas/core/indexes/base.py:5204: error: Unused "type: ignore" comment [unused-ignore]
werkzeug (https://github.com/pallets/werkzeug)
+ src/werkzeug/datastructures/structures.py:648: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/datastructures/headers.py:108: error: Unused "type: ignore" comment [unused-ignore]
+ src/werkzeug/routing/rules.py:912: error: Unused "type: ignore" comment [unused-ignore]
jax (https://github.com/google/jax)
+ jax/_src/core.py:535: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/core.py:875: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/earray.py:33: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/prng.py:301: error: Unused "type: ignore" comment [unused-ignore]
+ jax/experimental/sparse/_base.py:34: error: Unused "type: ignore" comment [unused-ignore]
pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ pandas-stubs/core/generic.pyi:67: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/frame.pyi:375: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/indexes/base.pyi:75: error: Unused "type: ignore" comment [unused-ignore]
+ pandas-stubs/core/groupby/generic.pyi:209: error: Return type "Iterator[tuple[ByT, Series[S2]]]" of "__iter__" incompatible with return type "Iterator[tuple[Hashable, Series[S2]]]" in supertype "pandas.core.groupby.groupby.BaseGroupBy" [override]
+ pandas-stubs/core/groupby/generic.pyi:449: error: Return type "Iterator[tuple[ByT, DataFrame]]" of "__iter__" incompatible with return type "Iterator[tuple[Hashable, DataFrame]]" in supertype "pandas.core.groupby.groupby.BaseGroupBy" [override]
ibis (https://github.com/ibis-project/ibis)
- ibis/common/bases.py:167: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/common/bases.py:205: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/common/bases.py:249: error: Signature of "__hash__" incompatible with supertype "Slotted" [override]
- ibis/common/bases.py:249: note: Superclass:
- ibis/common/bases.py:249: note: None
- ibis/common/bases.py:249: note: Subclass:
- ibis/common/bases.py:249: note: def __hash__(self) -> int
- ibis/common/collections.py:153: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/common/collections.py:291: error: Signature of "__hash__" incompatible with supertype "Mapping" [override]
- ibis/common/collections.py:291: note: Superclass:
- ibis/common/collections.py:291: note: None
- ibis/common/collections.py:291: note: Subclass:
- ibis/common/collections.py:291: note: def __hash__(self) -> int
- ibis/common/collections.py:313: note: Superclass:
- ibis/common/collections.py:313: note: None
- ibis/common/collections.py:313: note: Subclass:
- ibis/common/collections.py:313: note: def __hash__(self) -> int
- ibis/common/collections.py:313: error: Signature of "__hash__" incompatible with supertype "Mapping" [override]
- ibis/common/deferred.py:180: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/common/patterns.py:660: error: Signature of "__hash__" incompatible with supertype "Slotted" [override]
- ibis/common/patterns.py:660: note: Superclass:
- ibis/common/patterns.py:660: note: None
- ibis/common/patterns.py:660: note: Subclass:
- ibis/common/patterns.py:660: note: def __hash__(self) -> int
- ibis/common/patterns.py:937: error: Signature of "__hash__" incompatible with supertype "Slotted" [override]
- ibis/common/patterns.py:937: note: Superclass:
- ibis/common/patterns.py:937: note: None
- ibis/common/patterns.py:937: note: Subclass:
- ibis/common/patterns.py:937: note: def __hash__(self) -> int
- ibis/common/grounds.py:164: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/common/grounds.py:220: error: Signature of "__hash__" incompatible with supertype "Comparable" [override]
- ibis/common/grounds.py:220: note: Superclass:
- ibis/common/grounds.py:220: note: None
- ibis/common/grounds.py:220: note: Subclass:
- ibis/common/grounds.py:220: note: def __hash__(self) -> int
- ibis/common/grounds.py:220: error: Signature of "__hash__" incompatible with supertype "Annotable" [override]
- ibis/common/grounds.py:220: note: Superclass:
- ibis/common/grounds.py:220: note: None
- ibis/common/grounds.py:220: note: Subclass:
- ibis/common/grounds.py:220: note: def __hash__(self) -> int
- ibis/common/egraph.py:124: error: Incompatible types in assignment (expression has type "None", base class "object" defined the type as "Callable[[], int]") [assignment]
- ibis/expr/datatypes/core.py:941: error: Definition of "__hash__" in base class "Concrete" is incompatible with definition in base class "Mapping" [misc]
- ibis/expr/schema.py:25: error: Definition of "__hash__" in base class "Concrete" is incompatible with definition in base class "Mapping" [misc]
- ibis/common/tests/test_grounds.py:142: error: Definition of "__hash__" in base class "Concrete" is incompatible with definition in base class "Mapping" [misc]
mkdocs (https://github.com/mkdocs/mkdocs)
+ mkdocs/utils/templates.py:47: error: Subclass of "ExtraScriptValue" and "str" cannot exist: would have incompatible method signatures [unreachable]
schema_salad (https://github.com/common-workflow-language/schema_salad)
+ schema_salad/jsonld_context.py: note: In function "pred":
+ schema_salad/jsonld_context.py:53:31: error: Subclass of "str" and "MutableMapping[Any, Any]" cannot exist: would have incompatible method signatures [unreachable]
+ schema_salad/jsonld_context.py:54:21: error: Statement is unreachable [unreachable]
+ schema_salad/schema.py: note: In function "get_anon_name":
+ schema_salad/schema.py:422:27: error: Subclass of "str" and "Mapping[Any, Any]" cannot exist: would have incompatible method signatures [unreachable]
+ schema_salad/schema.py:423:17: error: Statement is unreachable [unreachable]
static-frame (https://github.com/static-frame/static-frame)
+ static_frame/core/series.py:3346: error: Incompatible return value type (got "IndexBase", expected "TLabel | ndarray[Any, Any]") [return-value]
+ static_frame/core/frame.py:7056: error: Argument 1 to "index_from_optional_constructors" has incompatible type "TypeBlocks"; expected "TIndexInitializer" [arg-type]
+ static_frame/core/frame.py:7056: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:7056: note: Expected:
+ static_frame/core/frame.py:7056: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:7056: note: Got:
+ static_frame/core/frame.py:7056: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:7056: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:7056: note: Expected:
+ static_frame/core/frame.py:7056: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:7056: note: Got:
+ static_frame/core/frame.py:7056: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:7298: error: Argument 1 to "index_from_optional_constructors" has incompatible type "TypeBlocks"; expected "TIndexInitializer" [arg-type]
+ static_frame/core/frame.py:7298: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:7298: note: Expected:
+ static_frame/core/frame.py:7298: note: def __iter__(self) -> Iterator[TLabel]
+ static_frame/core/frame.py:7298: note: Got:
+ static_frame/core/frame.py:7298: note: def __iter__(self) -> Iterator[TypeBlocks]
+ static_frame/core/frame.py:7298: note: Following member(s) of "TypeBlocks" have conflicts:
+ static_frame/core/frame.py:7298: note: Expected:
+ static_frame/core/frame.py:7298: note: def __iter__(self) -> Iterator[Sequence[TLabel]]
+ static_frame/core/frame.py:7298: note: Got:
+ static_frame/core/frame.py:7298: note: def __iter__(self) -> Iterator[TypeBlocks]
xarray (https://github.com/pydata/xarray)
+ xarray/core/_typed_ops.py:93: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:362: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:736: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1164: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1376: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/_typed_ops.py:1502: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataset.py:1510: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataset.py: note: In class "Dataset":
+ xarray/core/dataset.py:1510: error: Cannot override instance variable (previously declared on base class "DatasetOpsMixin") with class variable [misc]
+ xarray/core/dataset.py:1510: note: Error code "misc" not covered by "type: ignore" comment
+ xarray/core/dataset.py: note: At top level:
+ xarray/core/dataarray.py:1364: error: Unused "type: ignore" comment [unused-ignore]
+ xarray/core/dataarray.py: note: In member "rename" of class "DataArray":
+ xarray/core/dataarray.py:2601: error: Argument "name" to "_replace" of "DataArray" has incompatible type "Hashable | Mapping[Any, Hashable]"; expected "Hashable | Default | None" [arg-type]
+ xarray/core/dataarray.py: note: At top level:
+ xarray/core/datatree.py:303: error: Unused "type: ignore" comment [unused-ignore]