Issues

Issue #857 new

autodoc: autodata fails to find the documentation

Victor Stinner
created an issue

I have two Python modules: enum.py and interfaces.py. 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: {{{

!python

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! http://www.chillingeffects.org/notice.cgi?sID=192703

    The website is down, you can get a copy in Google Cache: http://webcache.googleusercontent.com/search?q=cache:9-rmazECTEAJ:https://www.chillingeffects.org/notice.cgi%3FsID%3D192703%26print%3Dyes+

    "Autodata Ltd. French Solutions, Ltd GB" owning http://www.autodata.ltd.uk asked (January 24, 2012) to blacklist 205 warez URLs including this github issue.

  3. Log in to comment