Update typing for HostnameResolver #6823
Annotations
6 errors and 2 notices
Run tests:
src/trio/_socket.py#L215
src/trio/_socket.py:(215:16 - 222:9): Incompatible return value type (got "list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int]]]", expected "list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int] | tuple[int, bytes]]]") [return-value]
|
Run tests:
src/trio/_socket.py#L244
src/trio/_socket.py:(244:13 - 244:38): Argument 1 to "to_thread_run_sync" has incompatible type "Callable[[bytes | str | None, bytes | str | int | None, int, int, int, int], list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int]]]]"; expected "Callable[..., list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int] | tuple[int, bytes]]]]" [arg-type]
|
Run tests:
src/trio/_tests/test_socket.py#L213
src/trio/_tests/test_socket.py:(213:9 - 213:11): Argument 1 to "check" has incompatible type "list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int] | tuple[int, bytes]]]"; expected "list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int]]]" [arg-type]
|
Run tests:
src/trio/_tests/test_socket.py#L228
src/trio/_tests/test_socket.py:(228:9 - 228:11): Argument 1 to "check" has incompatible type "list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int] | tuple[int, bytes]]]"; expected "list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int]]]" [arg-type]
|
Run tests
Mypy found type errors.
|
Run tests
Process completed with exit code 1.
|
Run tests:
src/trio/_socket.py#L215
src/trio/_socket.py:(215:16 - 222:9): "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance
|
Run tests:
src/trio/_socket.py#L215
src/trio/_socket.py:(215:16 - 222:9): Consider using "Sequence" instead, which is covariant
|
Loading