Skip to content

gi.module: make IntrospectionModule a ModuleType subclass

James Henstridge requested to merge jamesh/pygobject:module-type into main

Running help() on a gi.repository module with no overrides does not show useful help because IntrospectionModule is not a module subclass. So we get useless output like:

Help on IntrospectionModule in gi.repository object:

gi.repository.xlib = class IntrospectionModule(builtins.object)
 |  gi.repository.xlib(namespace, version=None)
 |
 |  An object which wraps an introspection typelib.
...

That is, we see documentation for the IntrospectionModule type rather than the module this instance represents. With the changes in this MR, it changes to:

Help on package gi.repository.xlib in gi.repository:

NAME
    gi.repository.xlib

PACKAGE CONTENTS
...

With details of the classes and functions in the module.

Merge request reports