[Tutor] subclass / superclass methods

Mike xcentric at unixgeek.net
Wed Jun 30 23:07:07 EDT 2004


Greetings,
I'm trying to find out why the below does not work as I'm expecting. I'm
sure there is a good answer, just I'm too green to understand why. Any
help would be appreciated. My expected results are for it to say 'Hello
other OnTick'

Thanks,
Mike



class object:

    def __init__(self):
        print 'Hello object __init__'


    def EventTick(self):
        print 'Hello object EventTick'
        self.OnTick()

    def OnTick(self):
        print 'Hello object OnTick'


class other(object):

    def __init__(self):
        print 'Hello other __init__'

    def OnEvent(self):
        print 'Hello other OnTick'

if __name__ == '__main__':
    my = other()
    my.EventTick()





More information about the Tutor mailing list