Request for including python signal helper in gnome 3.6
- From: Simon Feltman <s feltman gmail com>
- To: release-team gnome org
- Subject: Request for including python signal helper in gnome 3.6
- Date: Thu, 23 Aug 2012 00:14:51 -0700
Greetings,
This is a request for an exception to include the python signal helper to pygobject for gnome 3.6:
The original ticket is over 5 years old. I submitted a first pass patch 6 months ago and a final patch over a month ago and it was finally just looked at and approved, just too late for the upcoming release.
Essentially the feature removes a thorn in the side of GObject signals for python programmers. Currently to create a signal you use a dictionary, specifying types and flags along with a magically named closure:
class Spam(GObject.GObject):
__gsignals__ = {
'eggs_thrown': (GObject.SIGNAL_RUN_FIRST, None, (int,))
}
def do_eggs_thrown(self, count):
print "egg count", count
The patch adds a sugary syntax that makes use of python decorators and function annotations available in python 3:
class Spam(GObject.GObject):
@GObject.Signal
def eggs_thrown(self, count:int):
print("egg count", count)
The use of __gsignals__ simply becomes an implementation detail so no C binding code was changed and it is fully backwards compatible.
Thanks,
-Simon
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]