We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here's an example from the documentation:
import trio from typing import List from trio.testing import open_stream_to_socket_listener async def handler(stream: trio.abc.Stream) -> None: print(await stream.receive_some(1024)) async def main() -> None: async with trio.open_nursery() as nursery: # the problematic line listeners: List[trio.SocketListener] = await nursery.start( trio.serve_tcp, handler, 0 ) client_stream = await open_stream_to_socket_listener(listeners[0]) # Then send and receive data on 'client_stream', for example: await client_stream.send_all(b"GET / HTTP/1.0\r\n\r\n") trio.run(main)
mypy complains with this error message:
test1.py: 12:54 error mypy Argument 1 to "start" of "Nursery" has incompatible type "Callable[[Callable[[SocketStream], Awaitable[None]], int, DefaultNamedArg(Optional[AnyStr], 'host'), DefaultNamedArg(Optional[int], 'backlog'), DefaultNamedArg(Optional[Nursery], 'handler_nursery'), NamedArg(TaskStatus[Sequence[SocketListener]], 'task_status')], Coroutine[Any, Any, NoReturn]]"; expected <union: 5 items>
but the code runs fine... Am I missing something?
The text was updated successfully, but these errors were encountered:
This is a mypy bug: python/mypy#6492
I should probably update the README to list something that actually works. :-) Sorry this one bit you!
Sorry, something went wrong.
Filed #9 to track the doc fix, so closing this issue.
No branches or pull requests
Here's an example from the documentation:
mypy complains with this error message:
but the code runs fine... Am I missing something?
The text was updated successfully, but these errors were encountered: