Trouble subclass KeyFile
- From: Thomas Martitz <kugel rockbox org>
- To: "python-hackers-list gnome org" <python-hackers-list gnome org>
- Subject: Trouble subclass KeyFile
- Date: Mon, 06 Oct 2014 11:34:36 +0200
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]