Skip to content

Experiment: What happens when we only convert mutablemapping.pop keys to object? - #15304

Closed
randolf-scholz wants to merge 1 commit into
python:mainfrom
randolf-scholz:mutable_mapping_object_keys
Closed

Experiment: What happens when we only convert mutablemapping.pop keys to object?#15304
randolf-scholz wants to merge 1 commit into
python:mainfrom
randolf-scholz:mutable_mapping_object_keys

Conversation

@randolf-scholz

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

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

bidict (https://github.com/jab/bidict)
+ bidict/_bidict.py: note: In member "pop" of class "MutableBidict":+ bidict/_bidict.py:122:6: error: Signature of "pop" incompatible with supertype "typing.MutableMapping" [override]+ bidict/_bidict.py:122:6: note: Superclass:+ bidict/_bidict.py:122:6: note: @overload+ bidict/_bidict.py:122:6: note: def pop(self, object, /) -> VT+ bidict/_bidict.py:122:6: note: @overload+ bidict/_bidict.py:122:6: note: def pop(self, object, VT, /) -> VT+ bidict/_bidict.py:122:6: note: @overload+ bidict/_bidict.py:122:6: note: def [_T] pop(self, object, _T, /) -> VT | _T+ bidict/_bidict.py:122:6: note: Subclass:+ bidict/_bidict.py:122:6: note: @overload+ bidict/_bidict.py:122:6: note: def pop(self, KT, /) -> VT+ bidict/_bidict.py:122:6: note: @overload+ bidict/_bidict.py:122:6: note: def [DT] pop(self, KT, DT = ..., /) -> VT | DT
mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ bson/son.py:126: error: Signature of "pop" incompatible with supertype "typing.MutableMapping" [override]+ bson/son.py:126: note: Superclass:+ bson/son.py:126: note: @overload+ bson/son.py:126: note: def pop(self, object, /) -> _Value+ bson/son.py:126: note: @overload+ bson/son.py:126: note: def pop(self, object, _Value, /) -> _Value+ bson/son.py:126: note: @overload+ bson/son.py:126: note: def [_T] pop(self, object, _T, /) -> _Value | _T+ bson/son.py:126: note: Subclass:+ bson/son.py:126: note: def [_T] pop(self, key: _Key, *args: _Value | _T) -> _Value | _T+ pymongo/common.py:1045: error: Signature of "pop" incompatible with supertype "typing.MutableMapping" [override]+ pymongo/common.py:1045: note: Superclass:+ pymongo/common.py:1045: note: @overload+ pymongo/common.py:1045: note: def pop(self, object, /) -> Any+ pymongo/common.py:1045: note: @overload+ pymongo/common.py:1045: note: def pop(self, object, Any, /) -> Any+ pymongo/common.py:1045: note: @overload+ pymongo/common.py:1045: note: def [_T] pop(self, object, _T, /) -> Any | _T+ pymongo/common.py:1045: note: Subclass:+ pymongo/common.py:1045: note: def pop(self, key: str, *args: Any, **kwargs: Any) -> Any
pyodide (https://github.com/pyodide/pyodide)
+ src/py/_pyodide/_core_docs.py:1151: error: Signature of "pop" incompatible with supertype "typing.MutableMapping" [override]+ src/py/_pyodide/_core_docs.py:1151: note: Superclass:+ src/py/_pyodide/_core_docs.py:1151: note: @overload+ src/py/_pyodide/_core_docs.py:1151: note: def pop(self, object, /) -> VT+ src/py/_pyodide/_core_docs.py:1151: note: @overload+ src/py/_pyodide/_core_docs.py:1151: note: def pop(self, object, VT, /) -> VT+ src/py/_pyodide/_core_docs.py:1151: note: @overload+ src/py/_pyodide/_core_docs.py:1151: note: def [_T] pop(self, object, _T, /) -> VT | _T+ src/py/_pyodide/_core_docs.py:1151: note: Subclass:+ src/py/_pyodide/_core_docs.py:1151: note: @overload+ src/py/_pyodide/_core_docs.py:1151: note: def pop(self, KT, /) -> VT+ src/py/_pyodide/_core_docs.py:1151: note: @overload+ src/py/_pyodide/_core_docs.py:1151: note: def [T] pop(self, KT, VT | T = ..., /) -> VT | T
django-stubs (https://github.com/typeddjango/django-stubs)
+ django-stubs/http/request.pyi:202: error: Signature of "pop" incompatible with supertype "typing.MutableMapping" [override]+ django-stubs/http/request.pyi:202: note: Superclass:+ django-stubs/http/request.pyi:202: note: @overload+ django-stubs/http/request.pyi:202: note: def pop(self, object, /) -> str+ django-stubs/http/request.pyi:202: note: @overload+ django-stubs/http/request.pyi:202: note: def pop(self, object, str, /) -> str+ django-stubs/http/request.pyi:202: note: @overload+ django-stubs/http/request.pyi:202: note: def [_T] pop(self, object, _T, /) -> str | _T+ django-stubs/http/request.pyi:202: note: Subclass:+ django-stubs/http/request.pyi:202: note: @overload+ django-stubs/http/request.pyi:202: note: def pop(self, str | bytes, /) -> Never+ django-stubs/http/request.pyi:202: note: @overload+ django-stubs/http/request.pyi:202: note: def [_Z] pop(self, str | bytes, str | _Z = ..., /) -> Never
scrapy (https://github.com/scrapy/scrapy)
+ scrapy/utils/datatypes.py:98: error: Signature of "pop" incompatible with supertype "typing.MutableMapping" [override]+ scrapy/utils/datatypes.py:98: note: Superclass:+ scrapy/utils/datatypes.py:98: note: @overload+ scrapy/utils/datatypes.py:98: note: def pop(self, object, /) -> Any+ scrapy/utils/datatypes.py:98: note: @overload+ scrapy/utils/datatypes.py:98: note: def pop(self, object, Any, /) -> Any+ scrapy/utils/datatypes.py:98: note: @overload+ scrapy/utils/datatypes.py:98: note: def [_T] pop(self, object, _T, /) -> Any | _T+ scrapy/utils/datatypes.py:98: note: Subclass:+ scrapy/utils/datatypes.py:98: note: def [AnyStr: (str, bytes)] pop(self, key: AnyStr, *args: Any) -> Any+ scrapy/settings/__init__.py:629: error: Signature of "pop" incompatible with supertype "typing.MutableMapping" [override]+ scrapy/settings/__init__.py:629: note: Superclass:+ scrapy/settings/__init__.py:629: note: @overload+ scrapy/settings/__init__.py:629: note: def pop(self, object, /) -> Any+ scrapy/settings/__init__.py:629: note: @overload+ scrapy/settings/__init__.py:629: note: def pop(self, object, Any, /) -> Any+ scrapy/settings/__init__.py:629: note: @overload+ scrapy/settings/__init__.py:629: note: def [_T] pop(self, object, _T, /) -> Any | _T+ scrapy/settings/__init__.py:629: note: Subclass:+ scrapy/settings/__init__.py:629: note: def pop(self, name: bool | float | int | str | None, default: Any = ...) -> Any
steam.py (https://github.com/Gobot1234/steam.py)
+ steam/utils.py:559: error: Signature of "pop" incompatible with supertype "typing.MutableMapping" [override]+ steam/utils.py:559: note: Superclass:+ steam/utils.py:559: note: @overload+ steam/utils.py:559: note: def pop(self, object, /) -> _VT+ steam/utils.py:559: note: @overload+ steam/utils.py:559: note: def pop(self, object, _VT, /) -> _VT+ steam/utils.py:559: note: @overload+ steam/utils.py:559: note: def [_T] pop(self, object, _T, /) -> _VT | _T+ steam/utils.py:559: note: Subclass:+ steam/utils.py:559: note: @overload+ steam/utils.py:559: note: def pop(self, key: _KT) -> _VT+ steam/utils.py:559: note: @overload+ steam/utils.py:559: note: def [_T] pop(self, key: _KT, default: _VT | _T) -> _VT | _T- steam/ext/commands/utils.py:52: note: def pop(self, str, /) -> _VT+ steam/ext/commands/utils.py:52: note: def pop(self, object, /) -> _VT- steam/ext/commands/utils.py:52: note: def pop(self, str, _VT, /) -> _VT+ steam/ext/commands/utils.py:52: note: def pop(self, object, _VT, /) -> _VT- steam/ext/commands/utils.py:52: note: def [_T] pop(self, str, _T, /) -> _VT | _T+ steam/ext/commands/utils.py:52: note: def [_T] pop(self, object, _T, /) -> _VT | _T

Sign up for freeto 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

@randolf-scholz