Underscore data hiding (was python development practices?)

Paul Rubin phr-n2001d at nightsong.com
Thu Nov 1 01:16:50 CET 2001

m.faassen at vet.uu.nl (Martijn Faassen) writes:
> Data hiding isn't there to prevent evil programmers from doing evil
> things anyway; it's there to communicate intent and to prevent people
> from tripping over problems. 

That's true a lot of the time, but it's not universally true.  In java
for example, data hiding is definitely intended to thwart evil
programmers, and any failure of the data hiding is considered a
security bug requiring an immediate patch.  The closest Python has to
that is the rexec mechanism.  I'd like it a lot if Python extended
such protection to private instance variables.

More information about the Python-list mailing list