[PATCH] Don't use positional arguments to initialize Gtk objects

Vratislav Podzimek vpodzime at redhat.com
Tue Feb 18 12:29:19 UTC 2014


On Tue, 2014-02-18 at 07:21 -0500, David Shea wrote:
> On 02/18/2014 05:05 AM, Vratislav Podzimek wrote:
> > I think that instead of doing this "fix", we should file a bug on
> > pygobject-introspection because we really do nothing wrong or
> > non-standard. What exactly causes the error? The empty constructor or
> > calling those set_* methods? I believe the latter is okay and the
> > constructor is the same as it is called in the C except we don't pass
> > the object as the first instance. This really looks to me like a bug in
> > some other place not in our code.
> 
> The set_* methods are still fine, and I could put those back. The 
> complaint is about using unnamed arguments (something like 
> Gtk.Adjustment(1000,1000,1,10,0), or more often in our case 
> Gtk.Label("text")), and I figured if we're moving to lists of properties 
> for those calls, we might as well stick the half dozen or so function 
> calls right after the constructor into the property list, too.
Makes sense, nice change.

> 
> The reason for the warning, I suppose, is that with 
> gobject-introspection the constructor call isn't really the same as it 
> is in C. Most of the time the introspected call doesn't call the *_new 
> function (or doesn't call it when you'd expect it to) and skips right to 
> _init and a series of set_property calls.
Oh, that's "great". I don't think that's a good way to go, but it is
their business. Thanks for the additional explanation.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list