Mailing List Archive

Why are they? Re: Module Documentation Strings
Why are there documentation strings?

I mean, granted it would be very bad if the next version of python did not
support them, but why not just use comment lines?

Just curious why this convention is used.

--
Jeff Pinyan (jeffp@crusoe.net)
www.crusoe.net/~jeffp

Crusoe Communications, Inc.
732-728-9800
www.crusoe.net
Why are they? Re: Module Documentation Strings [ In reply to ]
On Sat, 3 Apr 1999 20:38:37 -0500, evil Japh wrote:
>Why are there documentation strings?
>I mean, granted it would be very bad if the next version of python did not
>support them, but why not just use comment lines?

Because comment lines are only visible within the source. Docstrings may be
accessed from anywhere, without any knowledge of the source.

>Jeff Pinyan (jeffp@crusoe.net)

--
-William "Billy" Tanksley
"But you shall not escape my iambics."
-- Gaius Valerius Catullus
Why are they? Re: Module Documentation Strings [ In reply to ]
[Jeff "evil Japh" Pinyan]
> Why are there documentation strings? ... why not just use
> comment lines?

D:\Python>python
Python 1.5.2b2 (#0, Feb 16 1999, 17:09:09) [MSC 32 bit (Intel)] on win32
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> dir([])
['append', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
'reverse', 'sort']
>>> print [].pop.__doc__
[].pop([index]) -> item -- remove and return item at index (default last)
>>>

Comments aren't available for introspection or interactive use.

that's-all-ly y'rs - tim