Underscore data hiding (was python development practices?)

Paul Rubin phr-n2001d at nightsong.com
Thu Nov 1 19:10:57 EST 2001


m.faassen at vet.uu.nl (Martijn Faassen) writes:
> > 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.

Depending on the name mangling scheme staying the same between python
version updates sounds like asking for trouble.



More information about the Python-list mailing list