Default indentation of 4 columns

Mark Jackson mjackson at wc.eso.mc.xerox.com
Mon Oct 25 00:05:03 EDT 1999


"Tim Peters" <tim_one at email.msn.com> writes:
> That's certainly clear!  The first line of the docstring doesn't help,
> though.  This has begun to matter (to me, and hence it should now matter to
> everyone <wink>) in the current CVS versions of IDLE and PythonWin, where
> Mark Hammond's calltips extension pops up a little window containing the
> first line of the docstring as you're typing a function/method call.  I've
> been playing with simply repeating the arglist in the docstring's first
> line, as in
> 
> def complex(real=0.0, imag=0.0):
>     """real=0., imag=0. -> return a complex number.
> 
>     Keyword arg "real" (default 0.) gives the real part of the result.
>     Keyword arg "imag" (default 0.) gives the imaginary part of the result.
>     """

IIRC there's a stricture in the Style Guide against repeating arglists
in doc strings.  It's certainly ugly, since when one looks at the code
the information is now present twice (possibly once right and once
wrong).  Surely the Right Thing is for calltips (and any other tool
that displays docstrings) to autogenerate the calling syntax from the
func_code?

-- 
Mark Jackson - http://www.alumni.caltech.edu/~mjackson
	Kids, thinking about theories is no way to get an education!
				- God-Man (Ruben Bolling)






More information about the Python-list mailing list