Re: Class Inheritance - What am I doing wrong?

2008-04-25 Thread Brian Munroe
On Apr 24, 10:11 pm, Arnaud Delobelle <[EMAIL PROTECTED]> 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, G

Re: Class Inheritance - What am I doing wrong?

2008-04-25 Thread Bruno Desthuilliers
Brian Munroe a écrit : Ok, so thanks everyone for the helpful hints. That *was* a typo on my part (should've been super(B...) not super(A..), but I digress) I'm building a public API. Along with the API I have a few custom types that I'm expecting API users to extend, if they need too. If I d

Re: Class Inheritance - What am I doing wrong?

2008-04-24 Thread Arnaud Delobelle
Brian Munroe <[EMAIL PROTECTED]> writes: > Ok, so thanks everyone for the helpful hints. That *was* a typo on my > part (should've been super(B...) not super(A..), but I digress) > > I'm building a public API. Along with the API I have a few custom > types that I'm expecting API users to extend,

Re: Class Inheritance - What am I doing wrong?

2008-04-24 Thread Gabriel Genellina
En Thu, 24 Apr 2008 18:18:01 -0300, Brian Munroe <[EMAIL PROTECTED]> escribió: Ok, so thanks everyone for the helpful hints. That *was* a typo on my part (should've been super(B...) not super(A..), but I digress) I'm building a public API. Along with the API I have a few custom types that I

Re: Class Inheritance - What am I doing wrong?

2008-04-24 Thread Brian Munroe
Ok, so thanks everyone for the helpful hints. That *was* a typo on my part (should've been super(B...) not super(A..), but I digress) I'm building a public API. Along with the API I have a few custom types that I'm expecting API users to extend, if they need too. If I don't use name mangling, i

Re: Class Inheritance - What am I doing wrong?

2008-04-24 Thread Gary Herron
Brian Munroe wrote: My example: class A(object): def __init__(self, name): self.__name = name def getName(self): return self.__name class B(A): def __init__(self,name=None): super(A,self).__init__() def setName(

Re: Class Inheritance - What am I doing wrong?

2008-04-24 Thread Arnaud Delobelle
Arnaud Delobelle <[EMAIL PROTECTED]> writes: > That is, if you also pass the name parameter to super(A,self).__init__ > in B's __init__ method Oops. should be super(B, self).__init__(name), of course. -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list

Re: Class Inheritance - What am I doing wrong?

2008-04-24 Thread Arnaud Delobelle
Brian Munroe <[EMAIL PROTECTED]> writes: > My example: > > class A(object): > > def __init__(self, name): > self.__name = name > > def getName(self): > return self.__name > > class B(A): > > def __init__(self,name=None): > super(A,self)._

Re: Class Inheritance - What am I doing wrong?

2008-04-24 Thread Virgil Dupras
On Apr 24, 10:22 pm, Brian Munroe <[EMAIL PROTECTED]> wrote: > My example: > > class A(object): > >         def __init__(self, name): >                 self.__name = name > >         def getName(self): >                 return self.__name > > class B(A): > >         def __init__(self,name=None): >

Class Inheritance - What am I doing wrong?

2008-04-24 Thread Brian Munroe
My example: class A(object): def __init__(self, name): self.__name = name def getName(self): return self.__name class B(A): def __init__(self,name=None): super(A,self).__init__() def setName(self, name):