Underscore data hiding (was python development practices?)

Steve Holden sholden at holdenweb.com
Fri Nov 2 13:19:00 CET 2001


"Paul Rubin" <phr-n2001d at nightsong.com> wrote in message
news:7xy9lquj5a.fsf at ruckus.brouhaha.com...
> 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.

I don't see why. It's a documented part of the language, so a change would
create backward incompatibility known to be anathema to the development
team.

regards
 Steve
--
http://www.holdenweb.com/








More information about the Python-list mailing list