On Mon, 27 Jul 2009 00:47:08 +0200, Diez B. Roggisch wrote:

>> Only modules, classes, and functions/methods can have docstrings
>> associated with them.
>> For anything else, you have to use comments; or you can mention them in
>> the docstrings of related things.
> 
> While this is technically true, writing docstrings to constants (module
> or classlevel) works when one uses tools such as epydoc to generate
> documentation.

I've never used epydoc, so I'm not sure what you mean. Presumably it uses 
source code analysis to detect:

CONSTANT = 42
"""This is a constant."""

even though the string is ignored by the compiler.

Is that correct?



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to