Hacker News new | ask | show | jobs
by forsaken 2017 days ago
Sphinx supports this for Python: https://www.sphinx-doc.org/en/master/usage/extensions/doctes...
1 comments

This is actually something from Python's stdlib: https://docs.python.org/3/library/doctest.html

Really underrated.

I seem to recall a talk given at one point that demonstrated a scheme that would reverse engineer functions out of whole cloth based only on docstrings and doctests, but of course I can't find it now.
My job is mostly Python. Did not know this existed.