Why does python not have a mechanism for data hiding?

greg gslindstrom at gmail.com
Tue Jun 3 10:32:55 EDT 2008


On May 25, 9:50 pm, miller.pau... at gmail.com wrote:
> On May 24, 9:41 am, Sh4wn <luckyluk... at gmail.com> wrote:
>
> > Python advertises himself as a full OOP language, but why does it miss
> > one of the basic principles of OOP? Will it ever be added to python?
>
> Others have already answered this directly, but I'd like to mention
> that languages I know of which have this feature also have a feature
> for getting around it.  (e.g. C++ and friend classes) I don't know
> about you, but I don't want features in the language that make me want
> to circumvent them. Do you?

I curious as how 'private' fits with the Open Source philosophy?
Sure, I can (and do) hide stuff with the double underscore technique,
but anyone using my code can open it up and add an "accessor" method
anytime they want, so nothing is really hidden.  I think the
"consenting adults" approach is the best one could hope for with FOSS.



More information about the Python-list mailing list