Expands tabs to spaces So this is a big hack in order to get lazy loaded docstring work for the ``help()``. In the ``help()`` function, ``pydoc`` and ``inspect`` are used. At some point the ``inspect.cleandoc`` method is called. To clean the docs ``expandtabs`` is ca
(self, tabsize=8)
| 47 | ) |
| 48 | |
| 49 | def expandtabs(self, tabsize=8): |
| 50 | """Expands tabs to spaces |
| 51 | |
| 52 | So this is a big hack in order to get lazy loaded docstring work |
| 53 | for the ``help()``. In the ``help()`` function, ``pydoc`` and |
| 54 | ``inspect`` are used. At some point the ``inspect.cleandoc`` |
| 55 | method is called. To clean the docs ``expandtabs`` is called |
| 56 | and that is where we override the method to generate and return the |
| 57 | docstrings. |
| 58 | """ |
| 59 | if self._docstring is None: |
| 60 | self._generate() |
| 61 | return self._docstring.expandtabs(tabsize) |
| 62 | |
| 63 | def __str__(self): |
| 64 | return self._generate() |