autodoc: autodata fails to find the documentation
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:
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.