Skip to content

Commit 436ebf8

Browse files
committed
Closes python#16155: fix a few errors in doctest output of the FAQ pages.
1 parent 8d867cb commit 436ebf8

3 files changed

Lines changed: 14 additions & 6 deletions

File tree

‎Doc/faq/design.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Why are floating point calculations so inaccurate?
4949
People are often very surprised by results like this::
5050

5151
>>> 1.2 - 1.0
52-
0.199999999999999996
52+
0.19999999999999996
5353

5454
and think it is a bug in Python. It's not. This has nothing to do with Python,
5555
but with how the underlying C platform handles floating point numbers, and

‎Doc/faq/general.rst‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -415,14 +415,22 @@ while they enter their program's source in another window. If they can't
415415
remember the methods for a list, they can do something like this::
416416

417417
>>> L = []
418-
>>> dir(L)
419-
['append', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
420-
'reverse', 'sort']
418+
>>> dir(L) # doctest: +NORMALIZE_WHITESPACE
419+
['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',
420+
'__delslice__', '__doc__', '__eq__', '__format__', '__ge__',
421+
'__getattribute__', '__getitem__', '__getslice__', '__gt__',
422+
'__hash__', '__iadd__', '__imul__', '__init__', '__iter__', '__le__',
423+
'__len__', '__lt__', '__mul__', '__ne__', '__new__', '__reduce__',
424+
'__reduce_ex__', '__repr__', '__reversed__', '__rmul__',
425+
'__setattr__', '__setitem__', '__setslice__', '__sizeof__', '__str__',
426+
'__subclasshook__', 'append', 'count', 'extend', 'index', 'insert',
427+
'pop', 'remove', 'reverse', 'sort']
421428
>>> help(L.append)
422429
Help on built-in function append:
423-
430+
<BLANKLINE>
424431
append(...)
425432
L.append(object) -- append object to end
433+
<BLANKLINE>
426434
>>> L.append(1)
427435
>>> L
428436
[1]

‎Doc/faq/windows.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ by entering a few expressions of your choice and seeing the results::
7474
>>> print "Hello"
7575
Hello
7676
>>> "Hello" * 3
77-
HelloHelloHello
77+
'HelloHelloHello'
7878

7979
Many people use the interactive mode as a convenient yet highly programmable
8080
calculator. When you want to end your interactive Python session, hold the Ctrl

0 commit comments

Comments
 (0)