Will python never intend to support private, protected and public?

Paul Rubin http
Wed Sep 28 07:54:23 EDT 2005


Tony Meyer <t-meyer at ihug.co.nz> writes:
> I'm not sure why I haven't seen this mentioned yet, but a leading
> double-underscore does really make a member private:...
> As you see, it's there in the dict, but it's obfuscated - but that's
> all that other languages do anyway.

No, that's false: in languages like Java, private variables are
actually private, and if functions in other classes can get to them,
it's an error in the Java implementation.  The security of things like
browser sandboxes depends on the privacy being enforced.

Python used to have something called Bastion which was intended to do
the same thing, but it didn't work and was removed.



More information about the Python-list mailing list