<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Oct 10, 2011, at 8:30 AM, Itamar Turner-Trauring wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On Mon, 2011-10-10 at 09:20 +0200, Albert Brandl wrote:<br></div></blockquote><div><br></div><blockquote type="cite"><div><blockquote type="cite">The following summary of Twisted projects on the current homepage might <br></blockquote><blockquote type="cite">be a good completion of the first paragraph:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">Twisted projects variously support TCP, UDP, SSL/TLS, multicast, Unix <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">sockets, a large number of protocols (including HTTP, NNTP, IMAP, SSH, <br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">IRC, FTP, and others), and much more.<br></blockquote></blockquote><br>I get the impression some people think Twisted is complex and big<br>because of all the features it has. So first I want to show them with<br>code "look it's so simple"... and only then give the full list of<br>features.<br></div></blockquote><div><br></div><div>I emphatically agree. &nbsp;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. &nbsp;Maybe we could have one more: like a 'hello world' IRC bot or something?</div><br><blockquote type="cite"><div><blockquote type="cite">One comment on the first code example:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">class EchoFactory(protocol.Factory):<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> &nbsp;&nbsp;def buildProtocol(self, addr):<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return Echo()<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">It might be better to just define the `protocol` class variable and <br></blockquote><blockquote type="cite">leave the instantiation to the default implementation of <br></blockquote><blockquote type="cite">`buildProtocol`. <br></blockquote><br>I have just closed two tickets making buildProtocol explicitly used in<br>both the server and client howtos, and I've also updated a relevant code<br>example in the website's FAQ. The current way of doing things, setting<br>an attribute on Factory, is really bad from an educational point of<br>view, since it makes protocol creation "magic". By having an explicit<br>buildProtocol users know where protocol instances come from, and how to<br>override this creation.<br></div></blockquote><div><br></div><div>These tickets are &lt;<a href="http://twistedmatrix.com/trac/ticket/5044">http://twistedmatrix.com/trac/ticket/5044</a>&gt; and &lt;<a href="http://twistedmatrix.com/trac/ticket/4761">http://twistedmatrix.com/trac/ticket/4761</a>&gt; if anyone wants more details on this. &nbsp;The existing behavior is <i>convenient</i>, 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.</div></div><div><br></div></body></html>