Why does python not have a mechanism for data hiding?

George Sakkis george.sakkis at gmail.com
Thu Jun 5 20:25:03 CEST 2008


On Jun 5, 2:07 pm, "Russ P." <Russ.Paie... at gmail.com> wrote:

> The "private" keyword goes further and prevents
> access even by derived classes. The double leading underscore in
> Python does no such thing.

Who develops these derived classes ? A competitor ? A malicious
hacker ? A spammer ? Who are you trying to hide your precious classes
from that the double leading underscore is not good enough
protection ? Even with a 'private' keyword, what stops them from doing
s/private/public/g ? Seriously, the "underscores are ugly" argument
has some merit but language enforced data hiding is overrated, if not
downright silly.



More information about the Python-list mailing list