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 677960 - Add Gee/Vala generics to PyGObject
Add Gee/Vala generics to PyGObject
Status: RESOLVED DUPLICATE of bug 639908
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-06-12 16:18 UTC by Daniel Espinosa
Modified: 2015-02-07 17:00 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Daniel Espinosa 2012-06-12 16:18:54 UTC
PyGObject support GLib.List<G> and GLib.Hash<K,V>, but what about Vala/Gee generics?

How can I create a GLib.List<string> in Python and how can I do the same for Vala/Gee generics?

May be defining a C API that defines functions that can handle generics and Python could define the type to use.

Gee's GIR defines lot of interfaces and most of them are Generics. Particulary when I use:

>> from gi.repository import Gee

works correctly but when try to use the interfaces or just to check it exists as type I wrote:

>> Gee.List

I get the following error:

Traceback (most recent call last):
  • File "<stdin>", line 1 in <module>
  • File "/usr/lib/python2.7/dist-packages/gi/module.py", line 243 in __getattr__
    return getattr(self._introspection_module, name)
  • File "/usr/lib/python2.7/dist-packages/gi/module.py", line 180 in __getattr__
    wrapper = metaclass(name, bases, dict_)
  • File "/usr/lib/python2.7/dist-packages/gi/types.py", line 232 in __init__
    register_interface_info(cls.__info__.get_g_type())
TypeError: must be an interface


By inspecting Gee's tree I found that most classes implement and interfaces have as prerequisite Gee.Traversable, but it is not defined:

>> Gee.Traversable

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/gi/module.py", line 243, in __getattr__
    return getattr(self._introspection_module, name)
  File "/usr/lib/python2.7/dist-packages/gi/module.py", line 105, in __getattr__
    self.__name__, name))
AttributeError: 'gi.repository.Gee' object has no attribute 'Traversable'
Comment 1 Evan Nemerson 2012-06-12 17:27:32 UTC
Duplicate of bug #639908?
Comment 2 Daniel Espinosa 2012-06-12 18:11:51 UTC

*** This bug has been marked as a duplicate of bug 639908 ***
Comment 3 André Klapper 2015-02-07 17:00:29 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]