Repository navigation
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: trio (https://github.com/python-trio/trio)
- src/trio/_socket.py:218: error: Incompatible return value type (got "list[tuple[Literal[AddressFamily.AF_INET], SocketKind, int, str, tuple[str, int]] | tuple[Literal[AddressFamily.AF_INET6], SocketKind, int, str, tuple[str, int, int, int] | tuple[int, bytes]]]", expected "list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int] | tuple[int, bytes]]]") [return-value]
- src/trio/_socket.py:218: note: "list" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
- src/trio/_socket.py:218: note: Consider using "Sequence" instead, which is covariant
- src/trio/_socket.py:247: error: Argument 1 to "to_thread_run_sync" has incompatible type "Callable[[bytes | str | None, bytes | str | int | None, int, int, int, int], list[tuple[Literal[AddressFamily.AF_INET], SocketKind, int, str, tuple[str, int]] | tuple[Literal[AddressFamily.AF_INET6], SocketKind, int, str, tuple[str, int, int, int] | tuple[int, bytes]]]]"; expected "Callable[[bytes | None, bytes | str | int | None, int, int, int, int], list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int] | tuple[int, bytes]]]]" [arg-type]
- src/trio/_dtls.py:739: error: Incompatible types in assignment (expression has type "tuple[bytes, bytes]", variable has type "None") [assignment]
- src/trio/_tests/test_highlevel_serve_listeners.py:148: error: Value of type "tuple[type[BaseException], BaseException, TracebackType | None] | tuple[None, None, None] | Literal[False]" is not indexable [index]
- src/trio/_tests/test_highlevel_serve_listeners.py:149: error: Value of type "tuple[type[BaseException], BaseException, TracebackType | None] | tuple[None, None, None] | Literal[False]" is not indexable [index]
- src/trio/_tests/test_socket.py:128: error: Argument 1 to "MonkeypatchedGAI" has incompatible type "Callable[[bytes | str | None, bytes | str | int | None, int, int, int, int], list[tuple[Literal[AddressFamily.AF_INET], SocketKind, int, str, tuple[str, int]] | tuple[Literal[AddressFamily.AF_INET6], SocketKind, int, str, tuple[str, int, int, int] | tuple[int, bytes]]]]"; expected "Callable[[str | bytes | None, str | bytes | int | None, int, int, int, int], list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int] | tuple[int, bytes]]]]" [arg-type]
- src/trio/_tests/test_exports.py:36: error: Incompatible types in assignment (expression has type "type[typing._Protocol]", variable has type "type[typing_extensions._Protocol]") [assignment]
- src/trio/_tests/test_exports.py:167: error: Unused "type: ignore" comment [unused-ignore]
- src/trio/_core/_tests/test_instrumentation.py:40: error: Unsupported operand types for in ("Task | None" and "Container[Task]") [operator]
- src/trio/_core/_tests/test_instrumentation.py:209: error: "Literal[False]" object is not iterable [misc]
+ src/trio/_core/_traps.py:65: 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: 2.4.0
+ src/trio/_core/_traps.py:65: note: use --pdb to drop into pdb
+ Traceback (most recent call last):
+ File "mypy/checker.py", line 781, in accept
+ File "mypy/nodes.py", line 1358, in accept
+ File "mypy/checker.py", line 5849, in visit_decorator
+ self.visit_decorator_inner(e)
+ File "mypy/checker.py", line 5870, in visit_decorator_inner
+ ret_type = self.named_generic_type("typing.AwaitableGenerator", [ty, tc, tr, t])
+ File "mypy/checker.py", line 7987, in named_generic_type
+ info = self.lookup_typeinfo(name)
+ File "mypy/checker.py", line 7994, in lookup_typeinfo
+ sym = self.lookup_qualified(fullname)
+ File "mypy/checker.py", line 8077, in lookup_qualified
+ raise KeyError(
+ KeyError: "Could not find builtin symbol 'AwaitableGenerator' (If you are running a test case, use a fixture that defines this symbol)"
+
starlette (https://github.com/encode/starlette)
+ .../projects/_starlette_venv/lib/python3.13/site-packages/trio/_core/_traps.py:65: 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: 2.4.0
+ .../projects/_starlette_venv/lib/python3.13/site-packages/trio/_core/_traps.py:65: note: use --pdb to drop into pdb
- starlette/testclient.py:86: error: Unused "type: ignore" comment [unused-ignore]
- starlette/testclient.py:87: error: Class cannot subclass "Response" (has type "Any") [misc]
- starlette/testclient.py:155: error: Unexpected keyword argument "status_code" for "WebSocketDenialResponse" [call-arg]
- starlette/testclient.py:155: note: "WebSocketDenialResponse" defined in "starlette.websockets"
- starlette/testclient.py:155: error: Unexpected keyword argument "headers" for "WebSocketDenialResponse" [call-arg]
- starlette/testclient.py:155: error: Unexpected keyword argument "content" for "WebSocketDenialResponse" [call-arg]
- starlette/testclient.py:199: error: Class cannot subclass "BaseTransport" (has type "Any") [misc]
- starlette/testclient.py:373: error: Unused "type: ignore" comment [unused-ignore]
- starlette/testclient.py:375: error: Unused "type: ignore" comment [unused-ignore]
- starlette/testclient.py:379: error: Class cannot subclass "Client" (has type "Any") [misc]
- starlette/testclient.py:432: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_testclient.py:267: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_testclient.py:268: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_templates.py:33: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_templates.py:34: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_templates.py:73: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_templates.py:74: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_templates.py:99: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_templates.py:100: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_templates.py:129: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_templates.py:130: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_templates.py:134: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_templates.py:135: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_templates.py:175: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_templates.py:176: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_requests.py:98: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_requests.py:119: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_requests.py:161: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_requests.py:180: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_requests.py:502: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_formparsers.py:300: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_formparsers.py:375: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_formparsers.py:399: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_formparsers.py:422: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_formparsers.py:686: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_formparsers.py:765: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_formparsers.py:795: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_formparsers.py:822: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_formparsers.py:851: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_formparsers.py:879: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_formparsers.py:909: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_formparsers.py:939: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_formparsers.py:956: error: Unused "type: ignore" comment [unused-ignore]
- tests/test_formparsers.py:1002: error: Unused "type: ignore" comment [unused-ignore]
+ Traceback (most recent call last):
+ File "mypy/checker.py", line 781, in accept
+ File "mypy/nodes.py", line 1358, in accept
+ File "mypy/checker.py", line 5849, in visit_decorator
+ self.visit_decorator_inner(e)
+ File "mypy/checker.py", line 5870, in visit_decorator_inner
+ ret_type = self.named_generic_type("typing.AwaitableGenerator", [ty, tc, tr, t])
+ File "mypy/checker.py", line 7987, in named_generic_type
+ info = self.lookup_typeinfo(name)
+ File "mypy/checker.py", line 7994, in lookup_typeinfo
+ sym = self.lookup_qualified(fullname)
+ File "mypy/checker.py", line 8077, in lookup_qualified
+ raise KeyError(
+ KeyError: "Could not find builtin symbol 'AwaitableGenerator' (If you are running a test case, use a fixture that defines this symbol)"
+
websockets (https://github.com/aaugustin/websockets)
+ .../projects/_websockets_venv/lib/python3.13/site-packages/trio/_core/_traps.py:65: 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: 2.4.0
+ .../projects/_websockets_venv/lib/python3.13/site-packages/trio/_core/_traps.py:65: note: use --pdb to drop into pdb
+ Traceback (most recent call last):
+ File "mypy/checker.py", line 781, in accept
+ File "mypy/nodes.py", line 1358, in accept
+ File "mypy/checker.py", line 5849, in visit_decorator
+ self.visit_decorator_inner(e)
+ File "mypy/checker.py", line 5870, in visit_decorator_inner
+ ret_type = self.named_generic_type("typing.AwaitableGenerator", [ty, tc, tr, t])
+ File "mypy/checker.py", line 7987, in named_generic_type
+ info = self.lookup_typeinfo(name)
+ File "mypy/checker.py", line 7994, in lookup_typeinfo
+ sym = self.lookup_qualified(fullname)
+ File "mypy/checker.py", line 8077, in lookup_qualified
+ raise KeyError(
+ KeyError: "Could not find builtin symbol 'AwaitableGenerator' (If you are running a test case, use a fixture that defines this symbol)"
+
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #7580