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 668288 - Be consistent in allowing extra arguments to main loop quit function
Be consistent in allowing extra arguments to main loop quit function
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
Git master
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2012-01-19 17:09 UTC by Stefano Facchini
Modified: 2012-01-24 15:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
pygmainloop: allow for extra arguments in 'quit' method (1.36 KB, patch)
2012-01-19 17:10 UTC, Stefano Facchini
committed Details | Review

Description Stefano Facchini 2012-01-19 17:09:34 UTC
Currently it is possible (via overrides) to do:

object.connect('signal-name', Clutter.main_quit)
object.connect('signal-name', Gtk.main_quit)

OTOH, for Glib mainloop the use of a lambda expression is required:

object.connect('signal-name', lambda x: some_main_loop.quit())

This is a bit unexpected, since the other two libraries in the GNOME stack with a main loop behave differently. It would be nice to be able to just do

object.connect('signal-name', some_main_loop.quit)

Or, maybe, even remove that override from Gtk and Clutter
Comment 1 Stefano Facchini 2012-01-19 17:10:13 UTC
Created attachment 205642 [details] [review]
pygmainloop: allow for extra arguments in 'quit' method

To allow for the common syntax:

    object.connect('signal-name', main_loop.quit)
Comment 2 Tomeu Vizoso 2012-01-24 15:28:25 UTC
Attachment 205642 [details] pushed as 29a3049 - pygmainloop: allow for extra arguments in 'quit' method