pydoc preference for triple double over triple single quotes-- anyreason?

Kent Johnson kent37 at tds.net
Sun Apr 17 16:17:05 EDT 2005


Brian van den Broek wrote:
> Kent Johnson said unto the world upon 2005-04-16 16:41:
> 
>> Brian van den Broek wrote:
>>> I've just spent a frustrating bit of time figuring out why pydoc 
>>> didn't extract a description from my module docstrings. Even though I 
>>> had a well formed docstring (one line, followed by a blank line, 
>>> followed by the rest of the docstring), when I ran Module docs, my 
>>> modules showed up as having "no description". ("Module docs" 
>>> referring to the shortcut installed on Windows that launches the 
>>> pydoc server.)
>>
>> ?? It works for me with triple-single quoted strings...from a quick 
>> look it appears that pydoc uses inspect which looks at the __doc__ 
>> attribute; do your modules have __doc__ attributes?
>>
> Kent, that's odd. My module does have a valid docstring and hence a 
> __doc__ attribute (I did explicitly check). help(my_module) works fine 
> at the prompt. It is just the results list in the TKinter interface to 
> the pydoc server application that doesn't seem to pick up my module's 
> description (in the first line of its docstring) when the docstring is 
> triple-single quoted.

I'm not sure what you mean by "the results list in the TKinter interface to the pydoc server". I ran 
the server, clicked "open browser" and browsed to a module in site-packages; that worked fine for me 
under Win2K and Python 2.4.1.

Kent



More information about the Python-list mailing list