Skip to content

overrides/Gio/ListStore: Support generic type parameter

Jan Tojnar requested to merge wip/jtojnar/gio-generic-list into main

Otherwise trying to use Gio.ListStore[Foo] in a type annotation in an app will crash:

TypeError: 'GObjectMeta' object is not subscriptable

And since we are already defining a type variable for the Generic parent class, we might as well put it to good use and add type annotations to the methods. Though these do not really appear to do anything other than serve as a documentation for now.

Required for https://github.com/pygobject/pygobject-stubs/pull/115 to be useful

Edited by Jan Tojnar

Merge request reports