GNOME Bugzilla – Bug 693839
Functions missing from pydoc report
Last modified: 2013-03-14 13:21:17 UTC
Created attachment 236148 [details] [review] Prefix __module__ attribute of function objects with gi.repository There appears to be a problem which causes introspected functions defined on module-level to be missing from pydoc's module report. I've looked into this and the root cause of the problem seems to be that introspected functions of a module `Foo' also have `Foo' set as their __module__ attribute instead of `gi.repository.Foo'. This poses problems in Python's pydoc.TextDoc.docmodule method where the list of module functions is first populated. Before the function is added to the funcs list inspect.getmodule() is called with the function object and the result is compared to the original module. The inspect.getmodule() call returns None though as the module is cached with "gi.repository.Foo" in sys.modules instead of "Foo". If a module defines __all__ this check is skipped. I've attached a patch which fixes the issue. It also corrects a typo in two docstrings of the same module.
Thanks. Commited with an additional fix for function caches which was found running "make check" The following fixes have been pushed:
*** Bug 695394 has been marked as a duplicate of this bug. ***