typeshed
typeshed copied to clipboard
Add additional dict get overload
Diff from mypy_primer, showing the effect of this PR on open source code:
steam.py (https://github.com/Gobot1234/steam.py)
+ steam/ext/commands/utils.py:43: note: @overload
+ steam/ext/commands/utils.py:43: note: def [_T] get(self, object, _T, /) -> _VT | _T
AutoSplit (https://github.com/Toufool/AutoSplit)
+ src/capture_method/__init__.py:106:5: error: Signature of "get" incompatible with supertype "dict" [override]
+ src/capture_method/__init__.py:106:5: note: Superclass:
+ src/capture_method/__init__.py:106:5: note: @overload
+ src/capture_method/__init__.py:106:5: note: def get(self, CaptureMethodEnum, /) -> type[CaptureMethodBase] | None
+ src/capture_method/__init__.py:106:5: note: @overload
+ src/capture_method/__init__.py:106:5: note: def get(self, CaptureMethodEnum, type[CaptureMethodBase], /) -> type[CaptureMethodBase]
+ src/capture_method/__init__.py:106:5: note: @overload
+ src/capture_method/__init__.py:106:5: note: def [_T] get(self, CaptureMethodEnum, _T, /) -> type[CaptureMethodBase] | _T
+ src/capture_method/__init__.py:106:5: note: @overload
+ src/capture_method/__init__.py:106:5: note: def [_T] get(self, object, _T, /) -> type[CaptureMethodBase] | _T
+ src/capture_method/__init__.py:106:5: note: Subclass:
+ src/capture_method/__init__.py:106:5: note: def get(self, key: CaptureMethodEnum, object = ..., /) -> Any
pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/arrays/arrow/array.py:2940: error: Unused "type: ignore" comment [unused-ignore]
openlibrary (https://github.com/internetarchive/openlibrary)
+ openlibrary/tests/accounts/test_models.py:2: note: ... from here:
pwndbg (https://github.com/pwndbg/pwndbg)
+ pwndbg/commands/ai.py:76: note: ... from here:
sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/builders/latex/transforms.py:543: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
+ https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
+ Please report a bug at https://github.com/python/mypy/issues
+ version: 1.10.0
+ sphinx/builders/latex/transforms.py:543: : note: use --pdb to drop into pdb
+ sphinx/builders/linkcheck.py:19: note: ... from here:
+ Traceback (most recent call last):
+ File "mypy/checker.py", line 589, in accept
+ File "mypy/nodes.py", line 1310, in accept
+ File "mypy/checker.py", line 2850, in visit_assignment_stmt
+ File "mypy/checker.py", line 2905, in check_assignment
+ File "mypy/checker.py", line 3607, in check_assignment_to_multiple_lvalues
+ File "mypy/checker.py", line 3685, in check_multi_assignment
+ File "mypy/checker.py", line 3824, in check_multi_assignment_from_tuple
+ AssertionError:
werkzeug (https://github.com/pallets/werkzeug)
+ src/werkzeug/datastructures/structures.pyi:31: error: Signature of "get" incompatible with supertype "dict" [override]
+ src/werkzeug/datastructures/structures.pyi:31: note: Superclass:
+ src/werkzeug/datastructures/structures.pyi:31: note: @overload
+ src/werkzeug/datastructures/structures.pyi:31: note: def get(self, K, /) -> V | None
+ src/werkzeug/datastructures/structures.pyi:31: note: @overload
+ src/werkzeug/datastructures/structures.pyi:31: note: def get(self, K, V, /) -> V
+ src/werkzeug/datastructures/structures.pyi:31: note: @overload
+ src/werkzeug/datastructures/structures.pyi:31: note: def [_T] get(self, K, _T, /) -> V | _T
+ src/werkzeug/datastructures/structures.pyi:31: note: @overload
+ src/werkzeug/datastructures/structures.pyi:31: note: def [_T] get(self, object, _T, /) -> V | _T
+ src/werkzeug/datastructures/structures.pyi:31: note: Subclass:
+ src/werkzeug/datastructures/structures.pyi:31: note: @overload
+ src/werkzeug/datastructures/structures.pyi:31: note: def get(self, key: K, default: None = ..., type: None = ...) -> V | None
+ src/werkzeug/datastructures/structures.pyi:31: note: @overload
+ src/werkzeug/datastructures/structures.pyi:31: note: def [D] get(self, key: K, default: D, type: None = ...) -> D | V
+ src/werkzeug/datastructures/structures.pyi:31: note: @overload
+ src/werkzeug/datastructures/structures.pyi:31: note: def [D, T] get(self, key: K, default: D, type: Callable[[V], T]) -> D | T
+ src/werkzeug/datastructures/structures.pyi:31: note: @overload
+ src/werkzeug/datastructures/structures.pyi:31: note: def [T] get(self, key: K, type: Callable[[V], T]) -> T | None
+ src/werkzeug/exceptions.py:94: error: Unused "type: ignore" comment [unused-ignore]
flake8 (https://github.com/pycqa/flake8)
+ tests/unit/plugins/finder_test.py:162: error: Argument 3 to "object" of "_patcher" has incompatible type overloaded function; expected overloaded function [arg-type]
scrapy (https://github.com/scrapy/scrapy)
+ scrapy/utils/datatypes.py:88: error: Signature of "get" incompatible with supertype "dict" [override]
+ scrapy/utils/datatypes.py:88: note: Superclass:
+ scrapy/utils/datatypes.py:88: note: @overload
+ scrapy/utils/datatypes.py:88: note: def get(self, Any, /) -> Any | None
+ scrapy/utils/datatypes.py:88: note: @overload
+ scrapy/utils/datatypes.py:88: note: def get(self, Any, Any, /) -> Any
+ scrapy/utils/datatypes.py:88: note: @overload
+ scrapy/utils/datatypes.py:88: note: def [_T] get(self, Any, _T, /) -> Any | _T
+ scrapy/utils/datatypes.py:88: note: @overload
+ scrapy/utils/datatypes.py:88: note: def [_T] get(self, object, _T, /) -> Any | _T
+ scrapy/utils/datatypes.py:88: note: Subclass:
+ scrapy/utils/datatypes.py:88: note: def [AnyStr in (str, bytes)] get(self, key: AnyStr, def_val: Any = ...) -> Any
+ scrapy/http/headers.py:85: error: Signature of "get" incompatible with supertype "dict" [override]
+ scrapy/http/headers.py:85: note: Superclass:
+ scrapy/http/headers.py:85: note: @overload
+ scrapy/http/headers.py:85: note: def get(self, Any, /) -> Any | None
+ scrapy/http/headers.py:85: note: @overload
+ scrapy/http/headers.py:85: note: def get(self, Any, Any, /) -> Any
+ scrapy/http/headers.py:85: note: @overload
+ scrapy/http/headers.py:85: note: def [_T] get(self, Any, _T, /) -> Any | _T
+ scrapy/http/headers.py:85: note: @overload
+ scrapy/http/headers.py:85: note: def [_T] get(self, object, _T, /) -> Any | _T
+ scrapy/http/headers.py:85: note: Subclass:
+ scrapy/http/headers.py:85: note: def [AnyStr in (str, bytes)] get(self, key: AnyStr, def_val: Any = ...) -> bytes | None
jax (https://github.com/google/jax)
+ jax/_src/core.py:1437: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/core.py:3098: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/interpreters/partial_eval.py:643: error: Unused "type: ignore" comment [unused-ignore]
+ jax/_src/interpreters/partial_eval.py:2677: error: Unused "type: ignore" comment [unused-ignore]
schemathesis (https://github.com/schemathesis/schemathesis)
+ src/schemathesis/cli/cassettes.py:354: note: In module imported here:
cwltool (https://github.com/common-workflow-language/cwltool)
+ cwltool/docker.py:15: note: ... from here:
+ note: ... from here,
+ note: ... from here,
+ cwltool/utils.py:52: note: ... from here:
schema_salad (https://github.com/common-workflow-language/schema_salad)
+ schema_salad/tests/test_cwl11.py:13: note: ... from here:
streamlit (https://github.com/streamlit/streamlit)
+ lib/tests/streamlit/web/cli_test.py:31: note: ... from here: