summaryrefslogtreecommitdiffstats
path: root/Doc/faq/general.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/faq/general.rst')
-rw-r--r--Doc/faq/general.rst19
1 files changed, 15 insertions, 4 deletions
diff --git a/Doc/faq/general.rst b/Doc/faq/general.rst
index 7ad949c..331e80c 100644
--- a/Doc/faq/general.rst
+++ b/Doc/faq/general.rst
@@ -415,14 +415,25 @@ 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',
+ >>> dir(L) # doctest: +NORMALIZE_WHITESPACE
+ ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',
+ '__dir__', '__doc__', '__eq__', '__format__', '__ge__',
+ '__getattribute__', '__getitem__', '__gt__', '__hash__', '__iadd__',
+ '__imul__', '__init__', '__iter__', '__le__', '__len__', '__lt__',
+ '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__',
+ '__repr__', '__reversed__', '__rmul__', '__setattr__', '__setitem__',
+ '__sizeof__', '__str__', '__subclasshook__', 'append', 'clear',
+ 'copy', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
'reverse', 'sort']
+ >>> [d for d in dir(L) if '__' not in d]
+ ['append', 'clear', 'copy', '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
+ L.append(object) -> None -- append object to end
+ <BLANKLINE>
>>> L.append(1)
>>> L
[1]