GNOME Bugzilla – Bug 658032
Drop legacy __gobject_init__ method of GObject.Object.
Last modified: 2011-09-13 20:40:51 UTC
This method was used in gobject initialization at some point, but now using GObject.__init__() is sufficient, so let's not keep this old method around and let people misuse it.
Created attachment 195453 [details] [review] Drop legacy __gobject_init__ method of GObject.Object.
I'd keep this around for a bit longer, at minimum until it is fully understood why i was created in the first place.
__gobject_init__() appeared in 2001, in the following commit, and wasn't touched since. commit 4a9a14997dc9d70e8e77a1c37ec3e06a109af300 Author: James Henstridge <james@daa.com.au> Date: Sun May 6 16:51:48 2001 +0000 2001-05-06 James Henstridge <james@daa.com.au> 2001-05-07 James Henstridge <james@daa.com.au> * examples/gobject/signal.py: 2001-05-06 James Henstridge <james@daa.com.au> * gobjectmodule.c (pygobject__init__): make the __init__ function choose what GType to pass to g_object_new based on the __gtype__ attribute. (pygobject_methods): make __gobject_init__ an alias for GObject.__init__. (pyg_type_register): new function for registering new GTypes. (pyg_type_register): register the type as "module+class" rather than "module.class", as the second form is considered bad (would like to use the second form though. * configure.in: require 1.3.5 versions of glib and gtk+ In 2005 it was only used within pygobject for two examples (properties and signals) like this: def __init__(self): self.__gobject_init__() I fail to grasp why __gobject_init__() was used instead of gobject.GObject.__init__() though, since they are aliases of each others. In third party code (straw) I've seen things like this which seems like a mistake: http://www.google.com/codesearch#eOp3Bj0kuIM/straw/model/__init__.py class Node(gobject.GObject): # implements __gsignal__ def __init__(self): GObject.__init__(self) class Category(Node): def __init__(self): GObject.__init__(self) Node.__gobject_init__(self) Node.__init__(self)
Attachment 195453 [details] pushed as 3ace5c2 - Drop legacy __gobject_init__ method of GObject.Object.