private

John Roth johnroth at ameritech.net
Sat Jun 29 18:35:37 EDT 2002


"Dave Reed" <dreed at capital.edu> wrote in message
news:mailman.1025382159.23425.python-list at python.org...
> > From: Peter Hansen <peter at engcorp.com>
> > X-Accept-Language: en
> > Newsgroups: comp.lang.python
> > Xref: news.baymountain.net comp.lang.python:170296
> > Sender: python-list-admin at python.org
> > Date: Sat, 29 Jun 2002 12:32:50 -0400
> >
> > Rhymes wrote:
> > >
> > > Is there any possibility to build up a _real_ private attribute?
> >
> > Please define what "_real_" means to you.  It's not apparent.
> >
> > > Such as C++ private data members...
> >
> > You realize that it's quite possible to get at private data members
> > in C++, don't you?
>
> Kind of off-topic, but this got me curious. The only way I could think
> of is to assume (which I think is always true) that the private data
> members are in order from the starting address so based on the offset
> from the address of the object you could access each one.
>
> Is there another way?

I believe he's talking about the preprocessor macro trick
of redefining the word 'private' as 'public.'

John Roth
>
> Dave
>
>





More information about the Python-list mailing list