Issue #857 new

autodoc: autodata fails to find the documentation

Victor Stinner
created an issue

I have two Python modules: and The enum module defines a Enum class (which has a docstring), interfaces defines a CLOSED constant which is an instance of Enum and has its own documentation (using "#: documentation of my constant" syntax). The autodoc extension fails to find CLOSED documentation, and fallback to Enum docstring.

Documenter.add_content() uses self.analyzer to locate the documentation of CLOSED, but it looks in enum module namespace instead of of interfaces namespace. CLOSED is a Enum object and Enum is defined in the enum module.

Documenter.generate() creates the analyzer using: {{{


self.analyzer = ModuleAnalyzer.for_module(self.real_modname) }}}

I suppose that it is useful to search in the namespace of "real" module, but in my case, we should also search in the namespace of the "local" module. Attached patch adds a new analyzer to search in the "local" module. It fixes my issue.

Comments (4)

  1. Anonymous

    I had this problem too but I decided that the problem stemmed from incorrectly identifying the real module. Adding a get_real_modname method to DataDocumenter more like the one in AttributeDocumenter solves it.

  2. Victor Stinner reporter

    Oh, this link has been blacklisted in Google thanks to the DMCA!

    The website is down, you can get a copy in Google Cache:

    "Autodata Ltd. French Solutions, Ltd GB" owning asked (January 24, 2012) to blacklist 205 warez URLs including this github issue.

  3. Log in to comment