Skip to content

Commit 77a61c0

Browse files
authored
gh-101100: amend references starting with !~ in gh-127054 (#127684)
1 parent 023b7d2 commit 77a61c0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Doc/tutorial/datastructures.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ Using Lists as Stacks
142142

143143
The list methods make it very easy to use a list as a stack, where the last
144144
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::
147147

148148
>>> stack = [3, 4, 5]
149149
>>> stack.append(6)
@@ -340,7 +340,7 @@ The :keyword:`!del` statement
340340
=============================
341341

342342
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
344344
which returns a value. The :keyword:`!del` statement can also be used to remove
345345
slices from a list or clear the entire list (which we did earlier by assignment
346346
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
500500
as keys if they contain only strings, numbers, or tuples; if a tuple contains
501501
any mutable object either directly or indirectly, it cannot be used as a key.
502502
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`.
505505

506506
It is best to think of a dictionary as a set of *key: value* pairs,
507507
with the requirement that the keys are unique (within one dictionary). A pair of

0 commit comments

Comments
 (0)