Underscore data hiding (was python development practices?)

Martijn Faassen m.faassen at vet.uu.nl
Thu Nov 1 18:53:32 EST 2001


Russell E. Owen <owen at astrono.junkwashington.emu> wrote:
> Personally, I prefer the effect of double underscore for this case, as 
> well. I can easily get to the variables by applying the name mangling 
> myself, yet cannot accidentally stomp on the variables in a subclass.

> To each his/her own.

That's a good point. I haven't done this because I've never remembered
the name mangling rule. I'm not even sure if it's really part of the
Python standard, but I'd guess it should be.

What if you don't know what superclass your variable or method might be coming
coming from? I suppose this would not be a common event, though.

Regards,

Martijn  
-- 
History of the 20th Century: WW1, WW2, WW3?
No, WWW -- Could we be going in the right direction?



More information about the Python-list mailing list