Access control in classes

Cees de Groot cg at gaia.cdg.acriter.nl
Thu Aug 31 15:54:41 EDT 2000


Fernando Rodriguez <frr at mindless.com> said:
>How can I implement some access control in my classes (equivalent to C++'s
>private, public, protected, etc...)? O:-)
>
Not. Python ain't a Bondage&Discipline language. There's just the 
convention to start private stuff with one or two underscores - in 
the latter case, Python mangles the name a bit so it gets "harder"
to access the name from outside the class' scope.

Access is granted in the documentation, mostly ("please override...",
"don't mess with this!", etcetera).

-- 
Cees de Groot               http://www.cdegroot.com     <cg at cdegroot.com>
GnuPG 1024D/E0989E8B 0016 F679 F38D 5946 4ECD  1986 F303 937F E098 9E8B
Forge your CipherSaber and list it: http://www.xs4all.nl/~cg/ciphersaber/



More information about the Python-list mailing list