@@ -142,8 +142,8 @@ Using Lists as Stacks
142
142
143
143
The list methods make it very easy to use a list as a stack, where the last
144
144
element added is the first element retrieved ("last-in, first-out"). To add an
145
- item to the top of the stack, use :meth: `!~list. append `. To retrieve an item from the
146
- top of the stack, use :meth: `!~list. pop ` without an explicit index. For example::
145
+ item to the top of the stack, use :meth: `!append `. To retrieve an item from the
146
+ top of the stack, use :meth: `!pop ` without an explicit index. For example::
147
147
148
148
>>> stack = [3, 4, 5]
149
149
>>> stack.append(6)
@@ -340,7 +340,7 @@ The :keyword:`!del` statement
340
340
=============================
341
341
342
342
There is a way to remove an item from a list given its index instead of its
343
- value: the :keyword: `del ` statement. This differs from the :meth: `!~list. pop ` method
343
+ value: the :keyword: `del ` statement. This differs from the :meth: `!pop ` method
344
344
which returns a value. The :keyword: `!del ` statement can also be used to remove
345
345
slices from a list or clear the entire list (which we did earlier by assignment
346
346
of an empty list to the slice). For example::
@@ -500,8 +500,8 @@ any immutable type; strings and numbers can always be keys. Tuples can be used
500
500
as keys if they contain only strings, numbers, or tuples; if a tuple contains
501
501
any mutable object either directly or indirectly, it cannot be used as a key.
502
502
You can't use lists as keys, since lists can be modified in place using index
503
- assignments, slice assignments, or methods like :meth: `!~list. append ` and
504
- :meth: `!~list. extend `.
503
+ assignments, slice assignments, or methods like :meth: `!append ` and
504
+ :meth: `!extend `.
505
505
506
506
It is best to think of a dictionary as a set of *key: value * pairs,
507
507
with the requirement that the keys are unique (within one dictionary). A pair of
0 commit comments