Why does python not have a mechanism for data hiding?

Russ P. Russ.Paielli at gmail.com
Thu Jun 5 14:43:31 EDT 2008


> For the record, I have made it abundantly clear that I don't think
> Python should not have as rigorous an encapsulation regime as C++ or
> Java. The worst that could happen with my proposition is that you
> would need to use a "mangled" name to access private data or methods.
> But you will be using the name many times, you can reassign your own
> name, of course, so the mangled name need not appear more than once
> where it is needed.

Let me try that again:

For the record, I have made it abundantly clear that I don't think
Python should have as rigorous an encapsulation regime as C++ or
Java. The worst that could happen with my proposition is that you
would need to use a "mangled" name to access private data or methods.
But if you will be using the name many times, you can reassign your
own
name, of course, so the mangled name need not appear more than once
where it is needed.



More information about the Python-list mailing list