> On 25 Jul 2016, at 12:10, Daniel Sank <sank.dan...@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

_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to