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
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
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,
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
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
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(
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
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)._
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):
>
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):
10 matches
Mail list logo