private variables/methods

gabor gabor at z10n.net
Thu Oct 9 08:06:06 EDT 2003


On Thu, 2003-10-09 at 10:12, Dave Benjamin wrote:
> In article <mailman.1065685337.1770.python-list at python.org>, gabor wrote:
> > as far as i know in python there aren't any private (i mean not accessible 
> > from the outside of the object) methods/fields.
> > 
> > why?
> 
> No offense, but this is like the 4000th time someone has asked that question
> here. Could you try searching Google groups first?

you're right, i'm sorry.

after reading the archives:

i think i didn't express myself too well.
i'll try again:

i'm aware of the fact that you can declare a variable private with "__".
but i just don't like prefix-notation. i don't like the mMember or
lpszCommandLine style notation, and also the $variable style ones.

at least for me it seemed that adding a "private" keyword somewhere is
more elegant. but there isn't anything like that.

that's why it seems to me that the designers of the language don't
recommend you to use private variables at all, but if you want, you can
use this 'hack' ( i mean the "__" notation).


thanks,
gabor






More information about the Python-list mailing list