private

Christopher A. Craig list-python at ccraig.org
Mon Jul 1 16:15:02 EDT 2002


"James Kew" <james.kew at btinternet.com> writes:

> "Peter Hansen" <peter at engcorp.com> wrote in message
> news:3D1DE132.4A890D9D at engcorp.com...
> > Rhymes wrote:
> > >
> > > Is there any possibility to build up a _real_ private attribute?
> > > Such as C++ private data members...
> >
> > You realize that it's quite possible to get at private data members
> > in C++, don't you?
> 
> I can't help feeling this is overly dismissive!
> 
> 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.

I would think docstrings, comments, and naming conventions sufficient
to provide a method for documenting what a class ought to be accessing.

-- 
Christopher A. Craig <list-python at ccraig.org>
"The shortest distance between two points is usually torn up." Frank Walsh





More information about the Python-list mailing list