[Numpy-discussion] Moving docstrings from C to Python

David Huard david.huard at gmail.com
Wed Aug 9 09:35:43 CDT 2006

I started to do the same with array methods, but before I spend too much
time on it, I'd like to be sure I'm doing the right thing.

1. In add_newdocs.py, add
from numpy.core import ndarray

2. then add an entry for each method, eg
    """a.var(axis=None, dtype=None)
    Return the variance, a measure of the spread of a distribution.

    The variance is the average of the squared deviations from the mean,
    i.e. var = mean((x - x.mean())**2).

    See also: std

3. in arraymethods.c,
delete static char doc_var[] = ...

remove doc_var in
{"var", (PyCFunction)array_variance,


2006/7/28, Sasha <ndarray at mac.com>:
> On 7/28/06, Stefan van der Walt <stefan at sun.ac.za> wrote:
> > Would anyone mind if the change was made?  If not, where should they
> > go? (numpy/add_newdocs.py or numpy/core/something)
> Another +1 for numpy/add_newdocs.py and a suggestion: check for
> Py_OptimizeFlag > 1 in add_newdoc so that docstrings are not loaded if
> python is invoked with -OO option.  This will  improve import numpy
> time and reduce the memory footprint.  I'll make the change if no one
> objects.
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20060809/7f752cec/attachment-0001.html 

More information about the Numpy-discussion mailing list