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 658032 - Drop legacy __gobject_init__ method of GObject.Object.
Drop legacy __gobject_init__ method of GObject.Object.
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2011-09-02 06:42 UTC by Steve Frécinaux
Modified: 2011-09-13 20:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Drop legacy __gobject_init__ method of GObject.Object. (2.22 KB, patch)
2011-09-02 06:42 UTC, Steve Frécinaux
committed Details | Review

Description Steve Frécinaux 2011-09-02 06:42:52 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.
Comment 1 Steve Frécinaux 2011-09-02 06:42:54 UTC
Created attachment 195453 [details] [review]
Drop legacy __gobject_init__ method of GObject.Object.
Comment 2 Johan (not receiving bugmail) Dahlin 2011-09-02 06:58:35 UTC
I'd keep this around for a bit longer, at minimum until it is fully understood why i was created in the first place.
Comment 3 Steve Frécinaux 2011-09-02 08:06:57 UTC
__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)
Comment 4 johnp 2011-09-13 20:40:47 UTC
Attachment 195453 [details] pushed as 3ace5c2 - Drop legacy __gobject_init__ method of GObject.Object.