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 672168 - Rename "property" to "Property"
Rename "property" to "Property"
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: gobject
unspecified
Other Linux
: Normal trivial
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2012-03-15 17:43 UTC by Simon Feltman
Modified: 2012-03-16 11:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Simple renaming to match the rest of GObject classes. (2.89 KB, patch)
2012-03-16 07:33 UTC, Simon Feltman
needs-work Details | Review
Renamed property to Property (15.16 KB, patch)
2012-03-16 10:52 UTC, Simon Feltman
committed Details | Review

Description Simon Feltman 2012-03-15 17:43:57 UTC
The property class living in gi/_gobject/propertyhelper.py should be renamed with title case as Property to match the rest of GObject. It was most likely initially named lowercase to match that of the builtin python property. Using title case here has a few advantages:
* It matches the style of the rest of GObject.
* It makes a clear distinction between the builtin python property class.
* Back compatibility can easily be supported in __init__.py with "property = Property"
Comment 1 Simon Feltman 2012-03-16 07:33:28 UTC
Created attachment 209902 [details] [review]
Simple renaming to match the rest of GObject classes.
Comment 2 Martin Pitt 2012-03-16 08:54:09 UTC
Review of attachment 209902 [details] [review]:

Thanks for this, this is indeed a nice stylistic cleanup. However, I think if we do it it should be done consistently throughout the source. I. e. "make check" still ought to pass even with the "property = Property" backwards compat disabled, as  at some point we want to drop this.

For example, gi/module.py still seems to use "property". gi/overrides/Gtk.py also uses "property", but there I think it's actually correct, it's a native Python property.

Can you please fix the rest of the code accordingly as well? (I. e. until make check passes, and then re-activate the backwards compat snippet).

Thanks for all your work!
Comment 3 Simon Feltman 2012-03-16 10:52:38 UTC
Created attachment 209915 [details] [review]
Renamed property to Property

Good points. I updated the unittests and re-ran with the back compatibility commented out. Also grepped for "property" in all the py files and verified gi/module.py, gi/overrides/Gtk.py, and gi/types.py are using the built-in property class.
Comment 4 Martin Pitt 2012-03-16 11:28:09 UTC
Thank you!

Pushed now, with an extra changelog comment that the old name is being kept for backwards compat.