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 679199 - Fix the return of the length of a TreePath
Fix the return of the length of a TreePath
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: introspection
unspecified
Other All
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2012-06-30 18:16 UTC by Marta Maria Casetti
Modified: 2012-07-04 08:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
overrides: Fixed the return of the length of a TreePath (921 bytes, patch)
2012-06-30 18:16 UTC, Marta Maria Casetti
none Details | Review

Description Marta Maria Casetti 2012-06-30 18:16:27 UTC
The length of a TreePath includes the separators, instead of being the length of the elements tuple.
Comment 1 Marta Maria Casetti 2012-06-30 18:16:30 UTC
Created attachment 217734 [details] [review]
overrides: Fixed the return of the length of a TreePath

The length of a TreePath currently is the length of the string
including the separator character ':'. It should be the number
of elements of the path.
Comment 2 Martin Pitt 2012-07-04 06:45:05 UTC
Out of interest, how do you get the wrong value? You cannot currently call len() on a Gtk.TreePath object at all.
Comment 3 Martin Pitt 2012-07-04 06:48:43 UTC
Thanks! I used the already existing get_depth() API instead and added tests:

http://git.gnome.org/browse/pygobject/commit/?id=0ddfecf3bf0a5d7893cd02cff41503d810ef6ce8
Comment 4 Marta Maria Casetti 2012-07-04 08:56:53 UTC
Thank you!