Inheritance question

Anthony anthonysmith80 at
Tue Mar 25 15:03:35 CET 2008

On Mar 25, 11:44 am, Tzury Bar Yochay <Afro.Syst... at> wrote:

> While my intention is to get 1.2 I get 2.2
> I would like to know what would be the right way to yield the expected
> results

Is this what you want?

class Foo(object):
    def __init__(self): = 1
    def getid(self):

class FooSon(Foo):
    def __init__(self):
        Foo.__init__(self) = 2
    def getid(self):
        a = Foo().getid()
        b =
        return '%d.%d' % (a,b)

>>> FooSon().getid()

Best wishes,

More information about the Python-list mailing list