Documenting Python code.

George Yoshida ml at dynkin.com
Tue May 3 10:46:44 EDT 2005


Isaac Rodriguez wrote:
 > Python is a dynamically typed language, which makes me think of the
 > importance of documenting not only the purpose of a particular 
function or
 > class method, but also what requirements should be met by the 
objects passed
 > as parameters, what will the function return, and what type of 
erros can
 > happen. I don't see any of this information in the __doc__ 
attributes, so I
 > was wondering if people is using some other way to document their code.

I guess you're talking about something like literate programming.
If so, doctest module may be useful for that purpose. Doctest can also
be used as a unittest.

-- 
george

http://www.dynkin.com/



More information about the Python-list mailing list