Skip to content

Add typeguards to __contains__ methods#15466

Closed
George-Ogden wants to merge 1 commit intopython:mainfrom
George-Ogden:container-typeguard
Closed

Add typeguards to __contains__ methods#15466
George-Ogden wants to merge 1 commit intopython:mainfrom
George-Ogden:container-typeguard

Conversation

@George-Ogden
Copy link

Currently in a draft state, this changes a small number of samples to look for errors in the mypy_primer.

@github-actions
Copy link
Contributor

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

nionutils (https://github.com/nion-software/nionutils)
+ nion/utils/StructuredModel.py:265: error: Signature of "__contains__" incompatible with supertype "typing.Sequence"  [override]
+ nion/utils/StructuredModel.py:265: note:      Superclass:
+ nion/utils/StructuredModel.py:265: note:          def __contains__(self, object, /) -> TypeGuard[Any]
+ nion/utils/StructuredModel.py:265: note:      Subclass:
+ nion/utils/StructuredModel.py:265: note:          def __contains__(self, Any, /) -> bool

bidict (https://github.com/jab/bidict)
+ bidict/_base.py: note: In class "BidictBase":
+ bidict/_base.py:282:5: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ bidict/_base.py:282:5: note:      Superclass:
+ bidict/_base.py:282:5: note:          def __contains__(self, object, /) -> TypeGuard[KT]
+ bidict/_base.py:282:5: note:      Subclass:
+ bidict/_base.py:282:5: note:          def __contains__(self, Any, /) -> bool

spark (https://github.com/apache/spark)
+ python/pyspark/sql/types.py:3625: error: Signature of "__contains__" incompatible with supertype "typing.Sequence"  [override]
+ python/pyspark/sql/types.py:3625: note:      Superclass:
+ python/pyspark/sql/types.py:3625: note:          def __contains__(self, object, /) -> TypeGuard[Any]
+ python/pyspark/sql/types.py:3625: note:      Subclass:
+ python/pyspark/sql/types.py:3625: note:          def __contains__(self, Any, /) -> bool
+ python/pyspark/sql/datasource.py:1297: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ python/pyspark/sql/datasource.py:1297: note:      Superclass:
+ python/pyspark/sql/datasource.py:1297: note:          def __contains__(self, object, /) -> TypeGuard[Any]
+ python/pyspark/sql/datasource.py:1297: note:      Subclass:
+ python/pyspark/sql/datasource.py:1297: note:          def __contains__(self, object, /) -> bool

graphql-core (https://github.com/graphql-python/graphql-core)
+ src/graphql/pyutils/ref_map.py:39: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ src/graphql/pyutils/ref_map.py:39: note:      Superclass:
+ src/graphql/pyutils/ref_map.py:39: note:          def __contains__(self, object, /) -> TypeGuard[K]
+ src/graphql/pyutils/ref_map.py:39: note:      Subclass:
+ src/graphql/pyutils/ref_map.py:39: note:          def __contains__(self, Any, /) -> bool

pwndbg (https://github.com/pwndbg/pwndbg)
+ pwndbg/aglib/kernel/kconfig_mod.py: note: In member "__contains__" of class "Kconfig":
+ pwndbg/aglib/kernel/kconfig_mod.py:108: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ pwndbg/aglib/kernel/kconfig_mod.py:108: note:      Superclass:
+ pwndbg/aglib/kernel/kconfig_mod.py:108: note:          def __contains__(self, object, /) -> TypeGuard[Any]
+ pwndbg/aglib/kernel/kconfig_mod.py:108: note:      Subclass:
+ pwndbg/aglib/kernel/kconfig_mod.py:108: note:          def __contains__(self, object, /) -> bool

tornado (https://github.com/tornadoweb/tornado)
+ tornado/httputil.py:337: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ tornado/httputil.py:337: note:      Superclass:
+ tornado/httputil.py:337: note:          def __contains__(self, object, /) -> TypeGuard[str]
+ tornado/httputil.py:337: note:      Subclass:
+ tornado/httputil.py:337: note:          def __contains__(self, object, /) -> bool

bokeh (https://github.com/bokeh/bokeh)
+ src/bokeh/models/util/structure.py:163: note: ... from here:

colour (https://github.com/colour-science/colour)
+ colour/utilities/structures.py:467: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ colour/utilities/structures.py:467: note:      Superclass:
+ colour/utilities/structures.py:467: note:          def __contains__(self, object, /) -> TypeGuard[Any]
+ colour/utilities/structures.py:467: note:      Subclass:
+ colour/utilities/structures.py:467: note:          def __contains__(self, str | Any, /) -> bool

schema_salad (https://github.com/common-workflow-language/schema_salad)
+ schema_salad/ref_resolver.py: note: In member "__contains__" of class "NormDict":
+ schema_salad/ref_resolver.py:115:5: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ schema_salad/ref_resolver.py:115:5: note:      Superclass:
+ schema_salad/ref_resolver.py:115:5: note:          def __contains__(self, object, /) -> TypeGuard[str]
+ schema_salad/ref_resolver.py:115:5: note:      Subclass:
+ schema_salad/ref_resolver.py:115:5: note:          def __contains__(self, Any, /) -> bool

spack (https://github.com/spack/spack)
+ lib/spack/spack/repo.py:1914: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ lib/spack/spack/repo.py:1914: note:      Superclass:
+ lib/spack/spack/repo.py:1914: note:          def __contains__(self, object, /) -> TypeGuard[str]
+ lib/spack/spack/repo.py:1914: note:      Subclass:
+ lib/spack/spack/repo.py:1914: note:          def __contains__(self, Any, /) -> bool

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/util/inspect.py: note: In member "__contains__" of class "TypeAliasNamespace":
+ sphinx/util/inspect.py:686:5: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ sphinx/util/inspect.py:686:5: note:      Superclass:
+ sphinx/util/inspect.py:686:5: note:          def __contains__(self, object, /) -> TypeGuard[str]
+ sphinx/util/inspect.py:686:5: note:      Subclass:
+ sphinx/util/inspect.py:686:5: note:          def __contains__(self, object, /) -> bool

xarray (https://github.com/pydata/xarray)
+ .../projects/_xarray_venv/lib/python3.13/site-packages/pandas-stubs/io/formats/style.pyi:17: note: ... from here,
+ .../projects/_xarray_venv/lib/python3.13/site-packages/pandas-stubs/core/frame.pyi:176: note: ... from here,
+ .../projects/_xarray_venv/lib/python3.13/site-packages/pandas-stubs/_typing.pyi:36: note: ... from here,
+ xarray/core/extension_array.py:27: note: ... from here:
+ xarray/core/utils.py: note: In member "__contains__" of class "Frozen":
+ xarray/core/utils.py:514: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ xarray/core/utils.py:514: note:      Superclass:
+ xarray/core/utils.py:514: note:          def __contains__(self, object, /) -> TypeGuard[K]
+ xarray/core/utils.py:514: note:      Subclass:
+ xarray/core/utils.py:514: note:          def __contains__(self, object, /) -> bool
+ xarray/core/indexes.py: note: In member "__contains__" of class "Indexes":
+ xarray/core/indexes.py:1936: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ xarray/core/indexes.py:1936: note:      Superclass:
+ xarray/core/indexes.py:1936: note:          def __contains__(self, object, /) -> TypeGuard[Any]
+ xarray/core/indexes.py:1936: note:      Subclass:
+ xarray/core/indexes.py:1936: note:          def __contains__(self, Any, /) -> bool
+ xarray/core/dataset_variables.py: note: In member "__contains__" of class "DataVariables":
+ xarray/core/dataset_variables.py:33: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ xarray/core/dataset_variables.py:33: note:      Superclass:
+ xarray/core/dataset_variables.py:33: note:          def __contains__(self, object, /) -> TypeGuard[Hashable]
+ xarray/core/dataset_variables.py:33: note:      Subclass:
+ xarray/core/dataset_variables.py:33: note:          def __contains__(self, Hashable, /) -> bool
+ xarray/core/coordinates.py: note: In member "__contains__" of class "AbstractCoordinates":
+ xarray/core/coordinates.py:112: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ xarray/core/coordinates.py:112: note:      Superclass:
+ xarray/core/coordinates.py:112: note:          def __contains__(self, object, /) -> TypeGuard[Hashable]
+ xarray/core/coordinates.py:112: note:      Subclass:
+ xarray/core/coordinates.py:112: note:          def __contains__(self, Hashable, /) -> bool
+ xarray/core/dataset.py: note: In member "__contains__" of class "Dataset":
+ xarray/core/dataset.py:1276: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ xarray/core/dataset.py:1276: note:      Superclass:
+ xarray/core/dataset.py:1276: note:          def __contains__(self, object, /) -> TypeGuard[Hashable]
+ xarray/core/dataset.py:1276: note:      Subclass:
+ xarray/core/dataset.py:1276: note:          def __contains__(self, object, /) -> bool
+ xarray/core/dataset.py: note: At top level:
+ xarray/core/datatree.py: note: In member "__contains__" of class "DataTree":
+ xarray/core/datatree.py:826: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ xarray/core/datatree.py:826: note:      Superclass:
+ xarray/core/datatree.py:826: note:          def __contains__(self, object, /) -> TypeGuard[str]
+ xarray/core/datatree.py:826: note:      Subclass:
+ xarray/core/datatree.py:826: note:          def __contains__(self, object, /) -> bool

sympy (https://github.com/sympy/sympy)
+ sympy/ntheory/factor_.py:707: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ sympy/ntheory/factor_.py:707: note:      Superclass:
+ sympy/ntheory/factor_.py:707: note:          def __contains__(self, object, /) -> TypeGuard[Any]
+ sympy/ntheory/factor_.py:707: note:      Subclass:
+ sympy/ntheory/factor_.py:707: note:          def __contains__(self, Any, /) -> bool
+ sympy/diffgeom/diffgeom.py:2261: error: Definition of "__contains__" in base class "_deprecated_container" is incompatible with definition in base class "Sequence"  [misc]
+ sympy/diffgeom/diffgeom.py:2265: error: Definition of "__contains__" in base class "_deprecated_container" is incompatible with definition in base class "Mapping"  [misc]

mitmproxy (https://github.com/mitmproxy/mitmproxy)
+ mitmproxy/addons/view.py:240: error: Signature of "__contains__" incompatible with supertype "typing.Sequence"  [override]
+ mitmproxy/addons/view.py:240: note:      Superclass:
+ mitmproxy/addons/view.py:240: note:          def __contains__(self, object, /) -> TypeGuard[Any]
+ mitmproxy/addons/view.py:240: note:      Subclass:
+ mitmproxy/addons/view.py:240: note:          def __contains__(self, Any, /) -> bool

urllib3 (https://github.com/urllib3/urllib3)
+ src/urllib3/_collections.py:268: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ src/urllib3/_collections.py:268: note:      Superclass:
+ src/urllib3/_collections.py:268: note:          def __contains__(self, object, /) -> TypeGuard[str]
+ src/urllib3/_collections.py:268: note:      Subclass:
+ src/urllib3/_collections.py:268: note:          def __contains__(self, object, /) -> bool

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]
+ mkdocs/theme.py:115: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ mkdocs/theme.py:115: note:      Superclass:
+ mkdocs/theme.py:115: note:          def __contains__(self, object, /) -> TypeGuard[str]
+ mkdocs/theme.py:115: note:      Subclass:
+ mkdocs/theme.py:115: note:          def __contains__(self, object, /) -> bool

pyodide (https://github.com/pyodide/pyodide)
+ src/py/_pyodide/_core_docs.py:1098: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ src/py/_pyodide/_core_docs.py:1098: note:      Superclass:
+ src/py/_pyodide/_core_docs.py:1098: note:          def __contains__(self, object, /) -> TypeGuard[KT]
+ src/py/_pyodide/_core_docs.py:1098: note:      Subclass:
+ src/py/_pyodide/_core_docs.py:1098: note:          def __contains__(self, object, /) -> bool

django-stubs (https://github.com/typeddjango/django-stubs)
+ django-stubs/test/utils.pyi:36: error: Signature of "__contains__" incompatible with supertype "typing.Sequence"  [override]
+ django-stubs/test/utils.pyi:36: note:      Superclass:
+ django-stubs/test/utils.pyi:36: note:          def __contains__(self, object, /) -> TypeGuard[dict[str, Any]]
+ django-stubs/test/utils.pyi:36: note:      Subclass:
+ django-stubs/test/utils.pyi:36: note:          def __contains__(self, object, /) -> bool

aioredis (https://github.com/aio-libs/aioredis)
+ aioredis/client.py:131: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ aioredis/client.py:131: note:      Superclass:
+ aioredis/client.py:131: note:          def __contains__(self, object, /) -> TypeGuard[Any]
+ aioredis/client.py:131: note:      Subclass:
+ aioredis/client.py:131: note:          def __contains__(self, Any, /) -> Any

beartype (https://github.com/beartype/beartype)
+ beartype/_util/cache/map/utilmaplru.py:208: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ beartype/_util/cache/map/utilmaplru.py:208: note:      Superclass:
+ beartype/_util/cache/map/utilmaplru.py:208: note:          def __contains__(self, object, /) -> TypeGuard[Any]
+ beartype/_util/cache/map/utilmaplru.py:208: note:      Subclass:
+ beartype/_util/cache/map/utilmaplru.py:208: note:          def __contains__(self, Hashable, Any = ..., Any = ..., Any = ..., Any = ..., /) -> bool

more-itertools (https://github.com/more-itertools/more-itertools)
+ more_itertools/more.pyi:528: error: Signature of "__contains__" incompatible with supertype "typing.Sequence"  [override]
+ more_itertools/more.pyi:528: note:      Superclass:
+ more_itertools/more.pyi:528: note:          def __contains__(self, object, /) -> TypeGuard[_T]
+ more_itertools/more.pyi:528: note:      Subclass:
+ more_itertools/more.pyi:528: note:          def __contains__(self, object, /) -> bool

static-frame (https://github.com/static-frame/static-frame)
+ static_frame/core/series_mapping.py:81: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ static_frame/core/series_mapping.py:81: note:      Superclass:
+ static_frame/core/series_mapping.py:81: note:          def __contains__(self, object, /) -> TypeGuard[TVKeys]
+ static_frame/core/series_mapping.py:81: note:      Subclass:
+ static_frame/core/series_mapping.py:81: note:          def __contains__(self, object, /) -> bool

pandas (https://github.com/pandas-dev/pandas)
+ pandas/plotting/_misc.py:752: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ pandas/plotting/_misc.py:752: note:      Superclass:
+ pandas/plotting/_misc.py:752: note:          def __contains__(self, object, /) -> TypeGuard[Any]
+ pandas/plotting/_misc.py:752: note:      Subclass:
+ pandas/plotting/_misc.py:752: note:          def __contains__(self, Any, /) -> bool

dd-trace-py (https://github.com/DataDog/dd-trace-py)
+ ddtrace/debugging/_probe/registry.py:206: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ ddtrace/debugging/_probe/registry.py:206: note:      Superclass:
+ ddtrace/debugging/_probe/registry.py:206: note:          def __contains__(self, object, /) -> TypeGuard[Any]
+ ddtrace/debugging/_probe/registry.py:206: note:      Subclass:
+ ddtrace/debugging/_probe/registry.py:206: note:          def __contains__(self, object, /) -> bool

ibis (https://github.com/ibis-project/ibis)
+ ibis/common/egraph.py:64: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ ibis/common/egraph.py:64: note:      Superclass:
+ ibis/common/egraph.py:64: note:          def __contains__(self, object, /) -> TypeGuard[K]
+ ibis/common/egraph.py:64: note:      Subclass:
+ ibis/common/egraph.py:64: note:          def __contains__(self, Any, /) -> bool
+ ibis/expr/datatypes/core.py:497: error: Signature of "__contains__" incompatible with supertype "typing.Sequence"  [override]
+ ibis/expr/datatypes/core.py:497: note:      Superclass:
+ ibis/expr/datatypes/core.py:497: note:          def __contains__(self, object, /) -> TypeGuard[int]
+ ibis/expr/datatypes/core.py:497: note:      Subclass:
+ ibis/expr/datatypes/core.py:497: note:          def __contains__(self, Any, /) -> bool

starlette (https://github.com/encode/starlette)
+ starlette/datastructures.py:304: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ starlette/datastructures.py:304: note:      Superclass:
+ starlette/datastructures.py:304: note:          def __contains__(self, object, /) -> TypeGuard[_KeyType]
+ starlette/datastructures.py:304: note:      Subclass:
+ starlette/datastructures.py:304: note:          def __contains__(self, Any, /) -> bool
+ starlette/datastructures.py:553: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ starlette/datastructures.py:553: note:      Superclass:
+ starlette/datastructures.py:553: note:          def __contains__(self, object, /) -> TypeGuard[str]
+ starlette/datastructures.py:553: note:      Subclass:
+ starlette/datastructures.py:553: note:          def __contains__(self, Any, /) -> bool

scrapy (https://github.com/scrapy/scrapy)
+ scrapy/settings/__init__.py:118: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ scrapy/settings/__init__.py:118: note:      Superclass:
+ scrapy/settings/__init__.py:118: note:          def __contains__(self, object, /) -> TypeGuard[bool | float | int | str | None]
+ scrapy/settings/__init__.py:118: note:      Subclass:
+ scrapy/settings/__init__.py:118: note:          def __contains__(self, Any, /) -> bool

pydantic (https://github.com/pydantic/pydantic)
+ pydantic/_internal/_namespace_utils.py:99: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ pydantic/_internal/_namespace_utils.py:99: note:      Superclass:
+ pydantic/_internal/_namespace_utils.py:99: note:          def __contains__(self, object, /) -> TypeGuard[str]
+ pydantic/_internal/_namespace_utils.py:99: note:      Subclass:
+ pydantic/_internal/_namespace_utils.py:99: note:          def __contains__(self, object, /) -> bool

websockets (https://github.com/aaugustin/websockets)
+ src/websockets/datastructures.py:91: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ src/websockets/datastructures.py:91: note:      Superclass:
+ src/websockets/datastructures.py:91: note:          def __contains__(self, object, /) -> TypeGuard[str]
+ src/websockets/datastructures.py:91: note:      Subclass:
+ src/websockets/datastructures.py:91: note:          def __contains__(self, object, /) -> bool

kopf (https://github.com/nolar/kopf)
+ kopf/_core/engines/indexing.py:102: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ kopf/_core/engines/indexing.py:102: note:      Superclass:
+ kopf/_core/engines/indexing.py:102: note:          def __contains__(self, object, /) -> TypeGuard[_K]
+ kopf/_core/engines/indexing.py:102: note:      Subclass:
+ kopf/_core/engines/indexing.py:102: note:          def __contains__(self, object, /) -> bool
+ kopf/_core/engines/indexing.py:270: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ kopf/_core/engines/indexing.py:270: note:      Superclass:
+ kopf/_core/engines/indexing.py:270: note:          def __contains__(self, object, /) -> TypeGuard[str]
+ kopf/_core/engines/indexing.py:270: note:      Subclass:
+ kopf/_core/engines/indexing.py:270: note:          def __contains__(self, object, /) -> bool

meson (https://github.com/mesonbuild/meson)
+ mesonbuild/dependencies/detect.py:40:5: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ mesonbuild/dependencies/detect.py:40:5: note:      Superclass:
+ mesonbuild/dependencies/detect.py:40:5: note:          def __contains__(self, object, /) -> TypeGuard[str]
+ mesonbuild/dependencies/detect.py:40:5: note:      Subclass:
+ mesonbuild/dependencies/detect.py:40:5: note:          def __contains__(self, object, /) -> bool

discord.py (https://github.com/Rapptz/discord.py)
+ discord/utils.py:264: error: Signature of "__contains__" incompatible with supertype "typing.Sequence"  [override]
+ discord/utils.py:264: note:      Superclass:
+ discord/utils.py:264: note:          def __contains__(self, object, /) -> TypeGuard[T_co]
+ discord/utils.py:264: note:      Subclass:
+ discord/utils.py:264: note:          def __contains__(self, Any, /) -> bool

pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/mark/structures.py:669: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ src/_pytest/mark/structures.py:669: note:      Superclass:
+ src/_pytest/mark/structures.py:669: note:          def __contains__(self, object, /) -> TypeGuard[str]
+ src/_pytest/mark/structures.py:669: note:      Subclass:
+ src/_pytest/mark/structures.py:669: note:          def __contains__(self, object, /) -> bool

steam.py (https://github.com/Gobot1234/steam.py)
+ steam/ext/commands/utils.py:29: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ steam/ext/commands/utils.py:29: note:      Superclass:
+ steam/ext/commands/utils.py:29: note:          def __contains__(self, object, /) -> TypeGuard[str]
+ steam/ext/commands/utils.py:29: note:      Subclass:
+ steam/ext/commands/utils.py:29: note:          def __contains__(self, object, /) -> bool
+ steam/trade.py:274: error: Signature of "__contains__" incompatible with supertype "typing.Sequence"  [override]
+ steam/trade.py:274: note:      Superclass:
+ steam/trade.py:274: note:          def __contains__(self, object, /) -> TypeGuard[ItemT]
+ steam/trade.py:274: note:      Subclass:
+ steam/trade.py:274: note:          def __contains__(self, object, /) -> bool

artigraph (https://github.com/artigraph/artigraph)
+ src/arti/internal/mappings.py:162: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ src/arti/internal/mappings.py:162: note:      Superclass:
+ src/arti/internal/mappings.py:162: note:          def __contains__(self, object, /) -> TypeGuard[str]
+ src/arti/internal/mappings.py:162: note:      Subclass:
+ src/arti/internal/mappings.py:162: note:          def __contains__(self, object, /) -> bool

Expression (https://github.com/cognitedata/Expression)
+ expression/collections/map.py:221: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ expression/collections/map.py:221: note:      Superclass:
+ expression/collections/map.py:221: note:          def __contains__(self, object, /) -> TypeGuard[_Key]
+ expression/collections/map.py:221: note:      Subclass:
+ expression/collections/map.py:221: note:          def __contains__(self, Any, /) -> bool

aiohttp (https://github.com/aio-libs/aiohttp)
+ aiohttp/web_routedef.py:168:5: error: Signature of "__contains__" incompatible with supertype "typing.Sequence"  [override]
+ aiohttp/web_routedef.py:168:5: note:      Superclass:
+ aiohttp/web_routedef.py:168:5: note:          def __contains__(self, object, /) -> TypeGuard[AbstractRouteDef]
+ aiohttp/web_routedef.py:168:5: note:      Subclass:
+ aiohttp/web_routedef.py:168:5: note:          def __contains__(self, object, /) -> bool
+ aiohttp/helpers.py:954:5: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ aiohttp/helpers.py:954:5: note:      Superclass:
+ aiohttp/helpers.py:954:5: note:          def __contains__(self, object, /) -> TypeGuard[str | AppKey[Any]]
+ aiohttp/helpers.py:954:5: note:      Subclass:
+ aiohttp/helpers.py:954:5: note:          def __contains__(self, object, /) -> bool
+ aiohttp/web_urldispatcher.py:1023:5: error: Signature of "__contains__" incompatible with supertype "typing.Mapping"  [override]
+ aiohttp/web_urldispatcher.py:1023:5: note:      Superclass:
+ aiohttp/web_urldispatcher.py:1023:5: note:          def __contains__(self, object, /) -> TypeGuard[str]
+ aiohttp/web_urldispatcher.py:1023:5: note:      Subclass:
+ aiohttp/web_urldispatcher.py:1023:5: note:          def __contains__(self, object, /) -> bool

@George-Ogden
Copy link
Author

Oops - I thought that might happen

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant