[Shiny new list address! This is exciting!]

So... IReactorTCP.connectTCP claims that 'host' should be a 'bytes': https://twistedmatrix.com/documents/current/api/twisted.internet.interfaces.IReactorTCP.html#connectTCP

PosixReactorBase.connectTCP doesn't tell us what type it should be, but, via tcp.Connector, ends up using it to construct an IPv4Address, which reckons it should be a 'str': https://twistedmatrix.com/documents/current/api/twisted.internet.address.IPv4Address.html#host. Connector also uses it to construct a tcp.Client, where it gets used as part of tcp.Client.addr, which is again supposed to be a 'str'.

I think in practice, either works, but it looks like most things *expect* it to be a 'str', with grudging support for 'bytes'. So my impression is the definition of the interface is wrong. Any thoughts/comments?

(While we're at it, IReactorTCP also claims that 'timeout' and 'bindAddress' are required parameters, even though all the implementations make them optional.)


_______________________________________________
Twisted mailing list -- twisted@python.org
To unsubscribe send an email to twisted-le...@python.org
https://mail.python.org/mailman3/lists/twisted.python.org/
Message archived at 
https://mail.python.org/archives/list/twisted@python.org/message/A4HYQE7FS7LHWCZOT6W22RCJFQ4ECWBI/
Code of Conduct: https://twisted.org/conduct

Reply via email to