Skip to content Skip to sidebar Skip to footer

Can Autodoc Be Used To Execute Code From Docstring?

When using Sphinx and autodoc to document a Python project, you can use :Example: to include a code sample in your module/class/function docstring, which Sphinx will kindly syntax

Solution 1:

The standard library includes doctest, which can identify, execute and verify interactive examples from text files or docstrings.


Post a Comment for "Can Autodoc Be Used To Execute Code From Docstring?"