Error when __doc__ is a property
I have instance-specific docstrings that are lazily evaluated (long story short, extracting the information needed to make the docstring would make the creation of instances much slower, while the docstring is very rarely used).
The implementation is roughly looking like this:
class A(object): """ Some doc one will not see. """ def get_doc(self): # get instance-specific documentation here __doc__ = property(get_doc)
When using sphinx to document this, it fails with:
site-packages/sphinx/util/docstrings.py", line 24, in prepare_docstring lines = s.expandtabs().splitlines() AttributeError: 'property' object has no attribute 'expandtabs'
(I am aware that I might be bending the rules regarding what
__doc__ should be).