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 693099 - Enum methods missing
Enum methods missing
Status: RESOLVED FIXED
Product: pygobject
Classification: Bindings
Component: general
3.4.x
Other Linux
: Normal minor
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2013-02-03 17:15 UTC by Christoph Reiter (lazka)
Modified: 2014-01-07 01:39 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Christoph Reiter (lazka) 2013-02-03 17:15:21 UTC
> self.assertEqual(Gtk.IconSize.from_name("gtk-menu"), 1)
> self.assertEqual(Gtk.IconSize.get_name(2), "gtk-small-toolbar")
> self.assertEqual(Gtk.IconSize.lookup(1), (True, 16, 16))

The following methods are also available under "Gtk.icon_size_from_name", but the versions above are in the gir and seem clearer.

Since the enum class is a subtype of int, this would need name escaping to avoid conflicts.
Comment 1 Simon Feltman 2013-02-03 20:38:32 UTC
Agreed. Your attention to detail is appreciated.

> Since the enum class is a subtype of int, this would need name escaping to
> avoid conflicts.

I consider this somewhat of an implementation detail which gives us bitwise operators for free and an easy way to marshal the values. So I don't think we need to worry about method name conflicts in this sense.
Comment 2 Simon Feltman 2014-01-07 01:39:23 UTC
Incredibly trivial fix for once.