A general purpose compiled language should be suitable for writing its own compiler, but I don’t think the same holds true for interpreted languages.
my_var = 5
"documentation for my_var"
def my_func():
"documentation for my_func"
also worth noting, pdoc didn't invent this design pattern, sphinx did (or perhaps something preceding sphinx?)