[Twisted-Python] SMTP patch

Jp Calderone exarkun at intarweb.us
Thu May 22 23:02:53 EDT 2003

On Fri, May 23, 2003 at 11:05:24AM +1000, Andrew Bennetts wrote:
> On Thu, May 22, 2003 at 04:48:35PM +0200, Anders Hammarquist wrote:
> > Make sure to drop any references to the file object containing the
> > message data.
> > 
> > +        if code in xrange(200,300):
> I think a much better way to do this is:
>     if 200 <= code <= 300:

    Interestingly, there was a thread on PyPy-dev on this subject.  I think
I agree with the line of thinking that says "x in y" expresses the intent
more accurately and at a higher level than "a <= x < y".  xrange() is a hack
though, so I would use range() :)

    BTW (the real reason I'm replying), I haven't forgotten about this
patch.  I'll try to get to it as quickly as I can.


"The problem is, of course, that not only is economics bankrupt but it has
 always been nothing more than politics in disguise ... economics is a form
 of brain damage."  -- Hazel Henderson
 up 21 days, 0:40, 0 users, load average: 0.04, 0.03, 0.00
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20030522/bc7c6533/attachment.pgp 

More information about the Twisted-Python mailing list