]> granicus.if.org Git - python/commitdiff
Closes #16155: fix a few errors in doctest output of the FAQ pages.
authorGeorg Brandl <georg@python.org>
Mon, 6 Oct 2014 15:51:46 +0000 (17:51 +0200)
committerGeorg Brandl <georg@python.org>
Mon, 6 Oct 2014 15:51:46 +0000 (17:51 +0200)
Doc/faq/design.rst
Doc/faq/general.rst
Doc/faq/windows.rst

index 66b065227f4fffd1c98692acc69df40c015ccf9e..2c986d4f529dc8f61b9852611ee39d4e82647293 100644 (file)
@@ -49,7 +49,7 @@ Why are floating point calculations so inaccurate?
 People are often very surprised by results like this::
 
    >>> 1.2 - 1.0
-   0.199999999999999996
+   0.19999999999999996
 
 and think it is a bug in Python. It's not.  This has nothing to do with Python,
 but with how the underlying C platform handles floating point numbers, and
index a09273b89cbf3f0e0b89a6cb8a68f12f6aea1a90..986c67b5c1fd245b3c378c8af9cd704a5271b2b0 100644 (file)
@@ -415,14 +415,22 @@ while they enter their program's source in another window.  If they can't
 remember the methods for a list, they can do something like this::
 
    >>> L = []
-   >>> dir(L)
-   ['append', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
-   'reverse', 'sort']
+   >>> dir(L) # doctest: +NORMALIZE_WHITESPACE
+   ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',
+   '__delslice__', '__doc__', '__eq__', '__format__', '__ge__',
+   '__getattribute__', '__getitem__', '__getslice__', '__gt__',
+   '__hash__', '__iadd__', '__imul__', '__init__', '__iter__', '__le__',
+   '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__reduce__',
+   '__reduce_ex__', '__repr__', '__reversed__', '__rmul__',
+   '__setattr__', '__setitem__', '__setslice__', '__sizeof__', '__str__',
+   '__subclasshook__', 'append', 'count', 'extend', 'index', 'insert',
+   'pop', 'remove', 'reverse', 'sort']
    >>> help(L.append)
    Help on built-in function append:
-
+   <BLANKLINE>
    append(...)
        L.append(object) -- append object to end
+   <BLANKLINE>
    >>> L.append(1)
    >>> L
    [1]
index 0379bac20209b6843d35dc32f084d00f6ef27ed4..cbc29ee97490edb5d10f678ec4866289c282aa09 100644 (file)
@@ -74,7 +74,7 @@ by entering a few expressions of your choice and seeing the results::
     >>> print "Hello"
     Hello
     >>> "Hello" * 3
-    HelloHelloHello
+    'HelloHelloHello'
 
 Many people use the interactive mode as a convenient yet highly programmable
 calculator.  When you want to end your interactive Python session, hold the Ctrl