While Python does not officially support docstrings for global variables, it is common to add them anyway:
debug = False
'''Set debug to True to see lots of intermediate results'''
Docstring for variable explains that Python does not directly offer access, but Sphinx is able to pull these out of a module. For something I am working on, I would like to access them as well. I think the ast module can do this. Anyone have any example code (using ast or other standard libraries) that can provide docstrings for variables defined in a module?