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 743214 - Allows passing arguments to opaque Boxed types
Allows passing arguments to opaque Boxed types
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2015-01-19 22:52 UTC by Garrett Regier
Modified: 2015-02-16 19:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Allows passing arguments to opaque Boxed types (3.94 KB, patch)
2015-01-19 22:54 UTC, Garrett Regier
none Details | Review
Allows passing arguments to opaque Boxed types v2 (3.95 KB, patch)
2015-01-20 09:29 UTC, Garrett Regier
reviewed Details | Review
Allows passing arguments to opaque Boxed types (3.69 KB, patch)
2015-01-25 06:19 UTC, Garrett Regier
committed Details | Review

Description Garrett Regier 2015-01-19 22:52:28 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.
Comment 1 Garrett Regier 2015-01-19 22:54:17 UTC
Created attachment 294929 [details] [review]
Allows passing arguments to opaque Boxed types
Comment 2 Garrett Regier 2015-01-20 09:29:11 UTC
Created attachment 294962 [details] [review]
Allows passing arguments to opaque Boxed types v2

Use work email address.
Comment 3 Simon Feltman 2015-01-24 07:39:03 UTC
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).
Comment 4 Garrett Regier 2015-01-25 06:19:35 UTC
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?
Comment 5 Garrett Regier 2015-02-14 20:02:20 UTC
ping?
Comment 6 Simon Feltman 2015-02-15 04:19:36 UTC
Review of attachment 295354 [details] [review]:

Looks good. Thanks!
Comment 7 Garrett Regier 2015-02-16 19:42:07 UTC
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.