win32com: subclass a com object?

tiddlerdeja at my-deja.com tiddlerdeja at my-deja.com
Mon Dec 13 08:34:08 EST 1999


As I said, I'm fairy new to COM too.

Is COM just interface inheritance? What about implementation
inheritance?

Roughly speaking, for COM object:

class foo:
    def bar():
        # do something
    def x():
        # blah
    def y():
        # blaah

If I want to create myFoo by inheriting from foo. I want to override
the method bar in the derived class. Can I just do:

class myFoo(foo):
    def bar():
        # myBar

Or do I have to do:

class myFoo():
    def __init__():
        self.f = foo()
    def bar():
        # my bar
    def x():
        #f.x()
    def y():
        #f.y()


Sorry for thr terrible python syntax, I'm new to this.

So my question is, is there no implementation inheritance in COM?

Any information greatly appreciated.



Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list