[Numpy-discussion] Code samples in docstrings mistaken as doctests

Pauli Virtanen pav@iki...
Mon Jun 23 13:37:39 CDT 2008

Mon, 23 Jun 2008 14:17:09 -0400, Alan McIntyre wrote:

> On Mon, Jun 23, 2008 at 2:02 PM, Fernando Perez <fperez.net@gmail.com>
> wrote:
>> There's also the option of marking them so doctest skips them via
>> #doctest: +SKIP
>> http://docs.python.org/lib/doctest-options.html
> For short examples, that seems like a good option, but it seems like you
> have to have that comment on every line that you want skipped. There are
> some long examples (like the one in lib/function_base.py:bartlett) that
> (to me) would look pretty ugly having that comment tacked on to every
> line.
> Either way is fine with me in the end, though, so long as it doesn't
> produce test failures. :)

Can you make the convention chosen for the examples (currently only in 
the doc wiki, not yet in SVN) to work: assuming "import numpy as np" in 

This would remove the need for those "from numpy import *" lines in the 
examples that I see were added in r5311.

Pauli Virtanen

More information about the Numpy-discussion mailing list