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 705754 - dir(GProps) not showing properties with Python3
dir(GProps) not showing properties with Python3
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2013-08-10 11:03 UTC by Christoph Reiter (lazka)
Modified: 2013-10-15 03:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add dir method to GObject props accessor (3.39 KB, patch)
2013-10-15 03:52 UTC, Simon Feltman
committed Details | Review

Description Christoph Reiter (lazka) 2013-08-10 11:03:37 UTC
A small difference I noticed. The following shows properties with python2.7 but not with python3.3

###########

from gi.repository import Gtk
x = Gtk.Window()
print(x.props)
print(dir(x.props))
Comment 1 Simon Feltman 2013-10-15 03:52:31 UTC
The following fix has been pushed:
a2fa531 Add dir method to GObject props accessor
Comment 2 Simon Feltman 2013-10-15 03:52:35 UTC
Created attachment 257320 [details] [review]
Add dir method to GObject props accessor

Remove special case __members__ attribute from the props accessor
objects getattr method. This has been deprecated since Python 2.3 and
removed in Python 3. Replace this with a __dir__ method making use of the
old members list building code. Additionally fix error where the
GObjectClass was being unref'd too many times when using dir(Object.props),
causing a GLib critical.