After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 687889 - Replace static GObject.get/set_property with introspection and python
Replace static GObject.get/set_property with introspection and python
Status: RESOLVED WONTFIX
Product: pygobject
Classification: Bindings
Component: introspection
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks: 685373
 
 
Reported: 2012-11-07 23:12 UTC by Simon Feltman
Modified: 2014-08-17 05:39 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Simon Feltman 2012-11-07 23:12:19 UTC
Now that bug 672727 has been pushed, we can start to experiment with changes like this. However, this is an area we should try to maintain good performance as heavy property access can occur when using libraries like clutter. I think if pure gi/python slows things down too much, we can still cleanup the get/set_property static methods writing/moving them into gi/_gi.so and using them from the "props" accessor implemented in python. This way we can cleanup and remove code from gi/_gobject/_gobject.so

The following example shows the gi versions of get/set_property are working:

from gi.repository import GObject
GIObject = GObject._introspection_module

class Spam(GObject.Object):
    eggs = GObject.Property(type=int)

spam = Spam()
value = GObject.Value()
value.init(GObject.TYPE_INT)

spam.eggs = 3
GIObject.Object.get_property(spam, 'eggs', value)
value.get_int() == 3 # True

value.set_int(5)
GIObject.Object.set_property(spam, 'eggs', value)
spam.eggs == 5 # True
Comment 1 Simon Feltman 2014-08-17 05:39:41 UTC
I don't think we'll ever be able to do this because property access needs introspection information which will be too slow to traverse in pure Python.