[PATCH] Don't use positional arguments to initialize Gtk objects
David Shea
dshea at redhat.com
Tue Feb 18 12:21:05 UTC 2014
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.
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.
More information about the anaconda-patches
mailing list