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 603536 - Don't set default constructors for structures
Don't set default constructors for structures
Status: RESOLVED FIXED
Product: pygi
Classification: Deprecated
Component: general
unspecified
Other Linux
: Normal normal
: 0.6
Assigned To: Simon van der Linden
pygi-maint
Depends on:
Blocks: 602830
 
 
Reported: 2009-12-01 22:23 UTC by Simon van der Linden
Modified: 2010-01-08 19:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't set a default constructor for structures (2.46 KB, patch)
2009-12-01 22:26 UTC, Simon van der Linden
none Details | Review
Don't set a default constructor for structures and update tests accordingly (5.75 KB, patch)
2009-12-11 19:48 UTC, Simon van der Linden
committed Details | Review

Description Simon van der Linden 2009-12-01 22:23:56 UTC
Confusing to the user and don't seem to play nice with overriding.

In the future, we may think about a default constructor that takes as argument keywords to set the fields' initial values.
Comment 1 Simon van der Linden 2009-12-01 22:26:04 UTC
Created attachment 148864 [details] [review]
Don't set a default constructor for structures

Tests need to be updated too, probably.
Comment 2 Simon van der Linden 2009-12-11 19:48:02 UTC
Created attachment 149604 [details] [review]
Don't set a default constructor for structures and update tests accordingly
Comment 3 Simon van der Linden 2010-01-05 21:30:43 UTC
The reason for this change is that setting __new__ in the metaclass doesn't let one overrides it afterwards, in a subclass (in my experience, at least, even though it seems weird).
Comment 4 Tomeu Vizoso 2010-01-08 12:45:55 UTC
Review of attachment 149604 [details] [review]:

Looks good.
Comment 5 Simon van der Linden 2010-01-08 19:36:25 UTC
Review of attachment 149604 [details] [review]:

Committed as b4189be2.