Trouble subclass KeyFile



Hello,

I have trouble to create a GLib.KeyFile subclass using the following snippet (pasted from interactive python):

>>>
>>> import gi
>>> from gi.repository import GLib
>>>
>>> class MyClass(GLib.KeyFile):
...   pass
...
>>> MyClass().__class__
<class 'gi.repository.GLib.KeyFile'>
>>>


Why is the __class__ of the MyClass instance GLib.KeyFile (and not MyClass)? As a as a result, I am not able to call MyClass methods on this instance.

The same procedure works with Gtk.Widget:

>>> import gi
>>> from gi.repository import Gtk
>>> class MyWid(Gtk.Widget):
...   pass
...
>>>
>>> MyWid().__class__
<class '__main__.MyWid'>
>>>

Thank you in advance.

Best regards.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]