private

Bjorn Pettersen BPettersen at NAREX.com
Sat Jun 29 11:50:25 EDT 2002


> From: Rhymes [mailto:rhymes at myself.com] 
> 
> Is there any possibility to build up a _real_ private 
> attribute? Such as C++ private data members... I know that 
> with double-underscore prefix (and the name mangling related) 
> I can " hide " data members but I think it's not a so crafty 
> trick... Is there any PEP about it? Will Guido insert a 
> private keyword in a future release of Python ?

Ok, here's a challenge for you... Write a C++ program with private data
members, then find at least two trivial ways of circumventing it.

Since private is just an indicator that you need to do some more work if
you want to access the member in C++, I don't see why Python should
bother to offer something more. If you can't expect your programmers to
act like grown-up's you really have more serious problems...

-- bjorn





More information about the Python-list mailing list