The stub for open_tcp_stream is missing the local_address argument.
I tried adding it as Optional[AnyStr] but this has the interesting effect that host and local_address must be the same type afterwards, e.g. await trio.open_tcp_stream(b"1.2.3.4", 567, local_address="8.9.10.11") is not possible according to mypy even though socket.connect and socket.bind accept both bytes and strs.
The stub for
open_tcp_stream
is missing thelocal_address
argument. I tried adding it asOptional[AnyStr]
but this has the interesting effect thathost
andlocal_address
must be the same type afterwards, e.g.await trio.open_tcp_stream(b"1.2.3.4", 567, local_address="8.9.10.11")
is not possible according to mypy even thoughsocket.connect
andsocket.bind
accept both bytes and strs.