Why does python not have a mechanism for data hiding?

Aahz aahz at pythoncraft.com
Sat May 24 23:30:16 EDT 2008


In article <52ba2118-d095-48a6-8844-2ee4c2ec2be1 at m36g2000hse.googlegroups.com>,
Sh4wn  <luckyluke56 at gmail.com> wrote:
>
>first, python is one of my fav languages, and i'll definitely keep
>developing with it. But, there's 1 one thing what I -really- miss:
>data hiding. I know member vars are private when you prefix them with
>2 underscores, but I hate prefixing my vars, I'd rather add a keyword
>before it.
>
>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?

Not directly addressing your point except insofar as it appears that
your understanding of OOP may be limited:

"...some experts might say a C++ program is not object-oriented without
inheritance and virtual functions.  As one of the early Smalltalk
implementors myself, I can say they are full of themselves." --zconcept
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Need a book?  Use your library!



More information about the Python-list mailing list