Re: [Twisted-Python] What's the purpose of __?

2011-02-16 Thread exarkun
On 03:19 pm, b...@fsn.hu wrote: > Hi, > >I know what it does, I just don't get why it was used in smtp.py. But >you are right, I should have mentioned that in the subject (adding ... >in smtp.py). The original author's intent is long since lost at this point. However, a safe guess is that the

Re: [Twisted-Python] What's the purpose of __?

2011-02-16 Thread Attila Nagy
Hi, I know what it does, I just don't get why it was used in smtp.py. But you are right, I should have mentioned that in the subject (adding ... in smtp.py). On 02/15/2011 11:33 PM, Jason Rennie wrote: In case you haven't seen it, here's what the python tutorial says about double-underscore

Re: [Twisted-Python] What's the purpose of __?

2011-02-16 Thread Attila Nagy
On 02/15/2011 11:03 PM, Phil Christensen wrote: > On Feb 15, 2011, at 5:36 AM, Attila Nagy wrote: >> Hi, >> >> I'm trying to do an LMTP implementation based on smtp.py and came to the >> issue of class private variables with double underscores. >> Examples: >> http://twistedmatrix.com/trac/browse

Re: [Twisted-Python] transport.write(a + b) versus [transport.write(a); transport.write(b)]

2011-02-16 Thread Itamar Turner-Trauring
On Wed, 2011-02-16 at 12:00 +, Carlos Valiente wrote: > From twisted.protocols.basic.IntNStringReceiver.sendString(): > > def sendString(self, string): > self.transport.write( > struct.pack(self.structFormat, len(string)) + string) > > Would it make sense to do something like t

[Twisted-Python] transport.write(a + b) versus [transport.write(a); transport.write(b)]

2011-02-16 Thread Carlos Valiente
>From twisted.protocols.basic.IntNStringReceiver.sendString(): def sendString(self, string): self.transport.write( struct.pack(self.structFormat, len(string)) + string) Would it make sense to do something like this instead: def sendString(self, string): self.transport.write(