On 2007-02-02, Toby A Inkster <[EMAIL PROTECTED]> wrote:
> Mizipzor wrote:
>> One thing is that in c++ im used to have private members in
>> classes and no member is altered except through the public
>> functions of the class.
>
> By convention, class members starting with a single underscore
> are considered private. 

An important consideration is that this convention is simply a
lower level of enforcement than C++ provides. Private members in
C++ are accessible if you use pointers.

> Class members starting with a double underscore are "mangled"
> which makes it more difficult for other code (even subclasses!)
> to access the member. Difficult though -- not impossible.

I think it's best to never use such names in new code. Python's
mangling is troubled, since it uses unqualified names in the
mangle, resulting in ambiguity.

-- 
Neil Cerutti
Ushers will eat latecomers. --Church Bulletin Blooper
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to