rtfd/readthedocs.org — pull request #156 by niklasb (2012-01-13 19:57:38+00:00)
Title: Improve Mock implementation

This one doesn't confuse Sphinx beyond repair when a project class inherits from a class in a mocked module.

There are two issues with the old code when a class inherits from a class defined in a mocked module:

* `sphinx.ext.autodoc` thinks the child class is only an alias, because its `__name__` method returns a mock object, which looks like '' after casting to a string.
* `sphinx.ext.viewcode` also is confused for some reason and chops of part of files' sources (very strange).

The new heuristic tries to prevent this by interpreting uppercase names as classes. Of course this can cause errors in cases where module-level variables are named in uppercase and accessed from other modules, but I think it's better then the way it's handled now.