[Twisted-Python] Request for help with Twisted bindings in M2Crypto

Cory Benfield cory at lukasa.co.uk
Mon Jul 25 06:19:55 MDT 2016


> On 25 Jul 2016, at 12:10, Daniel Sank <sank.daniel at gmail.com> wrote:
> 
> I just randomly clicked through the docs to this: https://twistedmatrix.com/documents/current/api/twisted._threads.IWorker.html <https://twistedmatrix.com/documents/current/api/twisted._threads.IWorker.html>
> 
> Note that:
> 
> 1. It is an interface, and I still don't _really_ understand what that means in Twisted.
> 
> 2. I have no idea what a "task" is. I realize this is python and yay duck-typing but not specifying the expected behavior of an argument seems like a big omission.
> 
> So, while the Twisted docs are great, consider not faulting people for being confused/daunted.
> 

Well, at this point I should argue that _threads, being prefixed by an underscore, is technically a private module to Twisted. That means that, realistically, you shouldn’t really need to consult this *at all*: if anyone outside of Twisted is using IWorker then they’re taking their life into their own hands. That largely argues for part 2, though modern Twisted development practice would still require that we document types and interfaces (see https://twistedmatrix.com/documents/current/api/twisted.web._http2.H2Connection.html <https://twistedmatrix.com/documents/current/api/twisted.web._http2.H2Connection.html>, for example).

As to interfaces, that’s a separate problem. Interfaces in Twisted are documented. See https://twistedmatrix.com/documents/current/core/howto/components.html <https://twistedmatrix.com/documents/current/core/howto/components.html> for a very lengthy discussion of interfaces in Twisted. Note that Glyph has also written heavily about interfaces: https://glyph.twistedmatrix.com/2009/02/explaining-why-interfaces-are-great.html <https://glyph.twistedmatrix.com/2009/02/explaining-why-interfaces-are-great.html>. Have those documents not helped, or have you been unable to find them?

Cory

-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20160725/a62b1576/attachment-0002.html>


More information about the Twisted-Python mailing list