[Twisted-Python] Proposed new homepage

Glyph glyph at twistedmatrix.com
Mon Oct 10 10:05:07 EDT 2011

On Oct 10, 2011, at 8:30 AM, Itamar Turner-Trauring wrote:

> On Mon, 2011-10-10 at 09:20 +0200, Albert Brandl wrote:

>> The following summary of Twisted projects on the current homepage might 
>> be a good completion of the first paragraph:
>>> Twisted projects variously support TCP, UDP, SSL/TLS, multicast, Unix 
>>> sockets, a large number of protocols (including HTTP, NNTP, IMAP, SSH, 
>>> IRC, FTP, and others), and much more.
> I get the impression some people think Twisted is complex and big
> because of all the features it has. So first I want to show them with
> code "look it's so simple"... and only then give the full list of
> features.

I emphatically agree.  It might be good to eventually have more of a link – demonstrate how the echo server actually leads into the web server – but the parallel structure of the examples there at least hints at it.  Maybe we could have one more: like a 'hello world' IRC bot or something?

>> One comment on the first code example:
>>> class EchoFactory(protocol.Factory):
>>>   def buildProtocol(self, addr):
>>>       return Echo()
>> It might be better to just define the `protocol` class variable and 
>> leave the instantiation to the default implementation of 
>> `buildProtocol`. 
> I have just closed two tickets making buildProtocol explicitly used in
> both the server and client howtos, and I've also updated a relevant code
> example in the website's FAQ. The current way of doing things, setting
> an attribute on Factory, is really bad from an educational point of
> view, since it makes protocol creation "magic". By having an explicit
> buildProtocol users know where protocol instances come from, and how to
> override this creation.

These tickets are <http://twistedmatrix.com/trac/ticket/5044> and <http://twistedmatrix.com/trac/ticket/4761> if anyone wants more details on this.  The existing behavior is convenient, and isn't going away, but it's very difficult for new users to infer what's going on without reading all of protocol.Factory's implementation.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20111010/f08b3318/attachment.htm 

More information about the Twisted-Python mailing list