Re: python strings ( function func_doc strings )

Steven D. Majewski (
Mon, 25 Apr 1994 17:23:39 -0400

IF some sort of triple quoted multi-line string is going to be added,
I would like to contradict myself (again) and AGAIN propose that an
optional lisp-like doc-string syntax be added to the syntax for def
( and maybe lambda ) along with a new function attribute: func_doc,
to hold that string.

def function( args ) 'minimal one line description of function' :

def otherfunction( args ) """
I haven't been following this discussion closely enough to remember
the current proposed rules for whitespace, etc. in these multi-line
strings but, I assume that whatever the syntax, it will solve the
problem of multi-line documentation. \n""" :

The doc string would be able to contain format variable like
$(paragraph) that could be expanded via:

import nroff # or TeX or html or whatever
posix.popen( os.environ['PAGER'],'w').write( function.func_doc % nroff.__dict__ )

( Actually, I hope something more portable that this, since that's why
I want the format codes to be inserted run-time! )

[ I'm still voting for vars() and explicit namespacing, Tim.
Oops! I forgot ... I gave *YOU* my proxy! :-> ]

I recall one of the criticisms of that idea was that it's usefulness
would be limited because of the awkwardness if more that one line
of documentation was required.

- Steve Majewski (804-982-0831) <sdm7g@Virginia.EDU>
- UVA Department of Molecular Physiology and Biological Physics