[Numpy-discussion] Docstring standard: how to specify variable types

Stefan van der Walt stefan at sun.ac.za
Thu Jan 24 15:53:11 EST 2008


Hi Robert

On Thu, Jan 24, 2008 at 01:15:13PM -0600, Robert Kern wrote:
> >>     5. Is the {'hi', 'ho'} syntax used when a parameter can only assume a
> >>       limited number of values?  In Python {} is a dictionary, so why not
> >>       use ('hi','ho') instead?
> >>
> >> Either would be fine. IIRC, the {} was inherited from epydoc consolidated
> >> fields.
> > 
> > I thought that, since we threw all epydoc guidelines out the window,
> > this would be a good time talk about it -- the next docday is just
> > around the corner!
> 
> Personally, I don't think it's worth standardizing. If it's readable
> and valid reST, just do it.

The attached output shows the difference between using {} and () -- it
doesn't seem to make a difference.  Since [] or () is normally used to
indicate a set, I found it more natural.

Either way, I think I'll follow your other suggestion and not use such
a list -- rather specify the default value in the prose.

Thanks
Stéfan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20080124/3eeae793/attachment.html>


More information about the NumPy-Discussion mailing list