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

Attila Nagy bra at fsn.hu
Wed Feb 16 10:19:26 EST 2011


  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:
>
> http://docs.python.org/tutorial/classes.html#private-variables
>
> Jason
>
> On Tue, Feb 15, 2011 at 5:36 AM, Attila Nagy <bra at fsn.hu 
> <mailto:bra at fsn.hu>> 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/browser/trunk/twisted/mail/smtp.py#L746
>     http://twistedmatrix.com/trac/browser/trunk/twisted/mail/smtp.py#L815
>     and a lot of occurrences in this file.
>
>     This makes me a problem, because I override some functions in a class,
>     named LMTP, so these cannot work together.
>
>     What's the rationale of using these, instead of static names?
>
>     Thanks,
>
>
>     _______________________________________________
>     Twisted-Python mailing list
>     Twisted-Python at twistedmatrix.com
>     <mailto:Twisted-Python at twistedmatrix.com>
>     http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
>
>
>
> -- 
> Jason Rennie
> Research Scientist, ITA Software
> 617-714-2645
> http://www.itasoftware.com/
>
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

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


More information about the Twisted-Python mailing list