Suppose we have a Python class that inherits from GObject.Object and from some interface.
class MyClass(GObject.Object, Gio.ListModel):
def __init__(self):
GObject.Object.__init__(self) # GObject initialized, what about ListModel?
def do_get_item(self, index):
whatever()
As far as I could see, every interface defines some methods and also methods prefixed by do_
. Those latter ones are the symbols to be overriden in the subclass.
I guess the unprefixed symbols get instantiated with some stubs that call Python functions back (the ones with do_
).
My question is, how are the slots for those stubs initialized? Does the GObject.Object.__init__
look for interfaces and creates slots for them? Or does something need to be called explicitly?
I tried to read the code, but everything seems to be auto-generated and there’s no actual code implementing most functions.