[docs] doctest directives not displayed in online documentation for 2.7.3

Hobson Lane hobsonlane at gmail.com
Thu Apr 26 07:00:43 CEST 2012


The doctest directive example code blocks on the doctest documentation
page do not contain the described directives (
http://docs.python.org/library/doctest.html) , approximately 1/3 of the way
down the page.

Perhaps sphinx or  is hiding all python doctest string comments and
processing the doctest directives rather than displaying the raw code
block? The html source shows no sign of the mentioned directives:

<p>For example, this test passes:</p>
<div class="highlight-python"><div class="highlight"><pre><span
class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span
class="nb">range</span><span class="p">(</span><span
class="mi">20</span><span class="p">)</span>
<span class="go">[0, 1, 2, 3, 4, 5, 6, 7, 8, 9,</span>

But the rst file at cpython/Docs/Library/doctest.rst does contain the
doctest directive (as a comment):

For example, this test passes::

    >>> print(list(range(20))) #doctest: +NORMALIZE_WHITESPACE
    [0,   1,  2,  3,  4,  5,  6,  7,  8,  9,

Here's the faulty rendering on a Chrome browser in Ubuntu:

... Use + to enable the named behavior, or - to disable it.

For example, this test passes:
>>>

>>> print range(20) [0,   1,  2,  3,  4,  5,  6,  7,  8,  9,10,  11, 12, 13, 14, 15, 16, 17, 18, 19]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20120426/74146ef8/attachment.html>


More information about the docs mailing list