Class Inheritance - What am I doing wrong?

Brian Munroe brian.e.munroe at gmail.com
Fri Apr 25 11:06:11 EDT 2008


On Apr 24, 10:11 pm, Arnaud Delobelle <arno... at googlemail.com> wrote:

> In python, use attributes starting with a single underscore (such as
> _name).  It tells users that they shouldn't mess with them.  By
> design, python doesn't include mechanisms equivalent to the Java / C++
> 'private'.

Arnaud, Gabriel:

Ok, Ok, I'll trust my users to not abuse my API :)  I didn't realize
that 'private' meant 'private, even to sub-classes' - it is all
becoming clear to me now!

Thanks for the help, and I'm going to re-read 'Python is Not Java'
right about now (I've spent the past few months knee-deep in Java, I
guess I need to cleanse myself)



More information about the Python-list mailing list