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 696027 - Support iteration and indexing on structs
Support iteration and indexing on structs
Status: RESOLVED OBSOLETE
Product: pygobject
Classification: Bindings
Component: introspection
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2013-03-18 04:03 UTC by Simon Feltman
Modified: 2018-01-10 20:23 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Simon Feltman 2013-03-18 04:03:31 UTC
The idea is to add generic support for __iter__ to the Boxed and Struct types. This will allow better compatibility with PyGTK as well as being a general convenience for Python programming. PyGTK generally did not expose structs and instead used tuples for data and this will also help compatibility through a generic technique.

There are a handful of functions which either replicate this behaviour for certain structs in overrides when returned, would benefit from the proposal, or the behaviour has been removed in PyGI and would help compatibility with PyGTK:

Gdk.Color
Gdk.RGBA
Gdk.Rectangle
Gtk.TargetEntry
Gtk.Border
GObject.SignalQuery
Clutter.Point
Clutter.Size
Clutter.Vertex
Clutter.Geometry
Clutter.Knot
Clutter.ActorBox
Pango.Rectangle

A second part of this proposal would be to allow coercion from tuples and dicts to Structs when marshaling from Python (similar to bug 686261). The benefit of this (and the above) is not only in removal of overrides which provide a similar thing, but more importantly it will guarantee API consistency throughout all methods which accept a particular struct instance as well as a tuple (Widget.drag_dest_set_target_list and related methods for example)
Comment 1 GNOME Infrastructure Team 2018-01-10 20:23:48 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/pygobject/issues/48.