Remember the mantra, "Explitic is better than implicit." ;-)
~/santa
On Tue, Mar 8, 2011 at 7:15 PM, Martin De Kauwe wrote:
> On Mar 9, 12:53 pm, "Rhodri James"
> wrote:
> > On Wed, 09 Mar 2011 01:00:29 -, Martin De Kauwe
>
> > wrote:
> >
> > > class BaseClass(object):
> > >def __ini
On Mar 9, 12:53 pm, "Rhodri James"
wrote:
> On Wed, 09 Mar 2011 01:00:29 -, Martin De Kauwe
> wrote:
>
> > class BaseClass(object):
> > def __init__(self, a, b, c, d):
> > self.a = a
> > self.b = b
> > self.c = c
> > self.d = d
>
> > class NewClass(BaseCla
On Wed, 09 Mar 2011 01:00:29 -, Martin De Kauwe
wrote:
class BaseClass(object):
def __init__(self, a, b, c, d):
self.a = a
self.b = b
self.c = c
self.d = d
class NewClass(BaseClass):
def __init__(self):
super(NewClass, self).__init__(new)
Here's how you do inheritance:
C:\>python
Python 2.7.1 (r271:86832, Nov 27 2010, 17:19:03) [MSC v.1500 64 bit (AMD64)]
on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> class BaseClass(object):
... def __init__(self, a, b, c, d):
... self.a = a
... self.b = b
...
On Mar 9, 11:50 am, "Rhodri James"
wrote:
> On Wed, 09 Mar 2011 00:29:18 -, Martin De Kauwe
> wrote:
>
>
>
>
>
>
>
> > On Mar 9, 10:20 am, Ethan Furman wrote:
> [snip]
> >> Just make sure and call the parent's constructor, either with
>
> >> class NewClass(BaseClass):
> >> def __init_
On Wed, 09 Mar 2011 00:29:18 -, Martin De Kauwe
wrote:
On Mar 9, 10:20 am, Ethan Furman wrote:
[snip]
Just make sure and call the parent's constructor, either with
class NewClass(BaseClass):
def __init__(self, ):
BaseClass.__init__(self, other_params)
or
class NewC
On Wed, Mar 9, 2011 at 9:20 AM, Ethan Furman wrote:
> Just make sure and call the parent's constructor, either with
>
> class NewClass(BaseClass):
> def __init__(self, ):
> BaseClass.__init__(self, other_params)
>
> or
>
> class NewClass(BaseClass):
> def __init__(self, ):
>
On Mar 9, 10:20 am, Ethan Furman wrote:
> Martin De Kauwe wrote:
> > Hi,
>
> > I think this might be obvious? I have a base class which contains X
> > objects which other classes inherit e.g.
>
> > class BaseClass(object):
> > def __init__(self, something, something_else):
> > self.som
Martin De Kauwe wrote:
Hi,
I think this might be obvious? I have a base class which contains X
objects which other classes inherit e.g.
class BaseClass(object):
def __init__(self, something, something_else):
self.something = something
self.something_else = something_else
On Mar 8, 2011 6:02 PM, "Martin De Kauwe" wrote:
>
> Hi,
>
> I think this might be obvious? I have a base class which contains X
> objects which other classes inherit e.g.
>
> class BaseClass(object):
>def __init__(self, something, something_else):
>self.something = something
>
10 matches
Mail list logo