diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2018-12-19 08:09:46 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-19 08:09:46 +0200 |
| commit | 2b57c43f21f891df4c6f2294a3b9e1b9029a16b6 (patch) | |
| tree | 0a875796fdcf96a15280d181efbf0c5fbb09eba6 /Doc/tutorial/datastructures.rst | |
| parent | 82d73554e4764350bfd8f13957c5e024ac95c4af (diff) | |
| download | cpython-git-2b57c43f21f891df4c6f2294a3b9e1b9029a16b6.tar.gz | |
bpo-35506: Remove redundant and incorrect links from keywords. (GH-11174)
Diffstat (limited to 'Doc/tutorial/datastructures.rst')
| -rw-r--r-- | Doc/tutorial/datastructures.rst | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst index b291d11595..b4db3f0159 100644 --- a/Doc/tutorial/datastructures.rst +++ b/Doc/tutorial/datastructures.rst @@ -216,9 +216,9 @@ or, equivalently:: which is more concise and readable. A list comprehension consists of brackets containing an expression followed -by a :keyword:`for` clause, then zero or more :keyword:`for` or :keyword:`if` +by a :keyword:`!for` clause, then zero or more :keyword:`!for` or :keyword:`!if` clauses. The result will be a new list resulting from evaluating the expression -in the context of the :keyword:`for` and :keyword:`if` clauses which follow it. +in the context of the :keyword:`!for` and :keyword:`!if` clauses which follow it. For example, this listcomp combines the elements of two lists if they are not equal:: @@ -330,12 +330,12 @@ See :ref:`tut-unpacking-arguments` for details on the asterisk in this line. .. _tut-del: -The :keyword:`del` statement -============================ +The :keyword:`!del` statement +============================= There is a way to remove an item from a list given its index instead of its value: the :keyword:`del` statement. This differs from the :meth:`pop` method -which returns a value. The :keyword:`del` statement can also be used to remove +which returns a value. The :keyword:`!del` statement can also be used to remove slices from a list or clear the entire list (which we did earlier by assignment of an empty list to the slice). For example:: |
