Re: [Tutor] Class Inheritance -> NameError

2005-11-30 Thread Tim Johnson
* John Fouhy <[EMAIL PROTECTED]> [051130 19:21]: <..snip...> > On 01/12/05, Tim Johnson <[EMAIL PROTECTED]> wrote: > superclass __init__ methods, or when you want to call them. So, it is > up to you to make that call. > > You can do that like this: > > class sub(test): > def __init__(self): >

Re: [Tutor] Class Inheritance -> NameError

2005-11-30 Thread John Fouhy
On 01/12/05, Tim Johnson <[EMAIL PROTECTED]> wrote: > My thanks to Christopher and Liam. I've revisited this > with the following: > class test: > def __init__(self): > self.s = ' there' > def val(self,V): > print '%s%s' % (V,self.s) > class sub(test): > def __init__(sel

Re: [Tutor] Class Inheritance -> NameError

2005-11-30 Thread Tim Johnson
My thanks to Christopher and Liam. I've revisited this with the following: class test: def __init__(self): self.s = ' there' def val(self,V): print '%s%s' % (V,self.s) class sub(test): def __init__(self): pass The following console session: >>> T = mylib.test() >

Re: [Tutor] Class Inheritance -> NameError

2005-11-30 Thread Liam Clarke-Hutchinson
ember 2005 3:46 p.m. To: tutor@python.org Subject: [Tutor] Class Inheritance -> NameError The following code snippet is meant to test inheritance: class test: def __init__(self,v): self.__val = v def val(self): print self.__val class sub(test): def __init__(self):

Re: [Tutor] Class Inheritance -> NameError

2005-11-30 Thread Christopher Arndt
Tim Johnson schrieb: > The following code snippet is meant to test inheritance: > class test: > def __init__(self,v): > self.__val = v > def val(self): > print self.__val > class sub(test): > def __init__(self): > val() > The following console session has an erro

[Tutor] Class Inheritance -> NameError

2005-11-30 Thread Tim Johnson
The following code snippet is meant to test inheritance: class test: def __init__(self,v): self.__val = v def val(self): print self.__val class sub(test): def __init__(self): val() The following console session has an error: >>> T = mylib.test('hello') >>> s = my