private

Paul Rubin phr-n2002b at NOSPAMnightsong.com
Sat Jun 29 16:15:02 EDT 2002


"James Kew" <james.kew at btinternet.com> writes:
> Yes, of course one can circumvent private in C++. But for me the main value
> of the public and private specifiers is that they _document_ to the client
> of the class what it should access and what it should not.

C++ may have been a bad example since the process's whole address
space is exposed to all parts of the program.  In Java though, private
methods and variables are enforced.

Actually someone should mention the rexec/Bastion module in Python,
which gives a kludgy way to enforce privacy within a process.  It
makes a sandbox-like mechanism where an object can enforce access
controls against a caller provided that the caller runs wrapped in a
special restricted environment.  



More information about the Python-list mailing list