GNOME Bugzilla – Bug 743214
Allows passing arguments to opaque Boxed types
Last modified: 2015-02-16 19:42:07 UTC
An opaque Boxed type has no size which causes the default constructor to raise an exception. However, the constructor will be overridden if the "new" method takes no arguments. It would be nice if it would also override the constructor if the Boxed type is opaque.
Created attachment 294929 [details] [review] Allows passing arguments to opaque Boxed types
Created attachment 294962 [details] [review] Allows passing arguments to opaque Boxed types v2 Use work email address.
Review of attachment 294962 [details] [review]: Thanks, I think this is a nice addition. ::: gi/pygi-boxed.c @@ +135,3 @@ + /* Only check when __new__ hasn't been overridden */ + if (self->ob_type->tp_new == _boxed_new && I would rather add a no-op __init__(*args, **kwargs) override in types.py than this check this here (where __new__ is being assigned).
Created attachment 295354 [details] [review] Allows passing arguments to opaque Boxed types (In reply to comment #3) > Review of attachment 294962 [details] [review]: > > Thanks, I think this is a nice addition. > > ::: gi/pygi-boxed.c > @@ +135,3 @@ > > + /* Only check when __new__ hasn't been overridden */ > + if (self->ob_type->tp_new == _boxed_new && > > I would rather add a no-op __init__(*args, **kwargs) override in types.py than > this check this here (where __new__ is being assigned). Done. Have a better name for the no-op function?
ping?
Review of attachment 295354 [details] [review]: Looks good. Thanks!
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.