Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2b57c43

Browse files
bpo-35506: Remove redundant and incorrect links from keywords. (GH-11174)
1 parent 82d7355 commit 2b57c43

45 files changed

Lines changed: 240 additions & 242 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Doc/faq/programming.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ Is it possible to write obfuscated one-liners in Python?
738738
--------------------------------------------------------
739739

740740
Yes. Usually this is done by nesting :keyword:`lambda` within
741-
:keyword:`lambda`. See the following three examples, due to Ulf Bartelt::
741+
:keyword:`!lambda`. See the following three examples, due to Ulf Bartelt::
742742

743743
from functools import reduce
744744

Doc/glossary.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ Glossary
336336
names, attribute access, operators or function calls which all return a
337337
value. In contrast to many other languages, not all language constructs
338338
are expressions. There are also :term:`statement`\s which cannot be used
339-
as expressions, such as :keyword:`if`. Assignments are also statements,
339+
as expressions, such as :keyword:`while`. Assignments are also statements,
340340
not expressions.
341341

342342
extension module
@@ -448,8 +448,8 @@ Glossary
448448

449449
generator expression
450450
An expression that returns an iterator. It looks like a normal expression
451-
followed by a :keyword:`for` expression defining a loop variable, range,
452-
and an optional :keyword:`if` expression. The combined expression
451+
followed by a :keyword:`!for` clause defining a loop variable, range,
452+
and an optional :keyword:`!if` clause. The combined expression
453453
generates values for an enclosing function::
454454

455455
>>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81

Doc/howto/functional.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ need to define a new function at all::
11081108
existing_files = filter(os.path.exists, file_list)
11091109

11101110
If the function you need doesn't exist, you need to write it. One way to write
1111-
small functions is to use the :keyword:`lambda` statement. ``lambda`` takes a
1111+
small functions is to use the :keyword:`lambda` expression. ``lambda`` takes a
11121112
number of parameters and an expression combining these parameters, and creates
11131113
an anonymous function that returns the value of the expression::
11141114

Doc/library/aifc.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Module :mod:`aifc` defines the following function:
4545
time how many samples you are going to write in total and use
4646
:meth:`writeframesraw` and :meth:`setnframes`.
4747
The :func:`.open` function may be used in a :keyword:`with` statement. When
48-
the :keyword:`with` block completes, the :meth:`~aifc.close` method is called.
48+
the :keyword:`!with` block completes, the :meth:`~aifc.close` method is called.
4949

5050
.. versionchanged:: 3.4
5151
Support for the :keyword:`with` statement was added.

Doc/library/contextlib.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
:mod:`contextlib` --- Utilities for :keyword:`with`\ -statement contexts
2-
========================================================================
1+
:mod:`!contextlib` --- Utilities for :keyword:`!with`\ -statement contexts
2+
==========================================================================
33

44
.. module:: contextlib
55
:synopsis: Utilities for with-statement contexts.
@@ -72,7 +72,7 @@ Functions and classes provided:
7272

7373
The function being decorated must return a :term:`generator`-iterator when
7474
called. This iterator must yield exactly one value, which will be bound to
75-
the targets in the :keyword:`with` statement's :keyword:`as` clause, if any.
75+
the targets in the :keyword:`with` statement's :keyword:`!as` clause, if any.
7676

7777
At the point where the generator yields, the block nested in the :keyword:`with`
7878
statement is executed. The generator is then resumed after the block is exited.
@@ -82,9 +82,9 @@ Functions and classes provided:
8282
the error (if any), or ensure that some cleanup takes place. If an exception is
8383
trapped merely in order to log it or to perform some action (rather than to
8484
suppress it entirely), the generator must reraise that exception. Otherwise the
85-
generator context manager will indicate to the :keyword:`with` statement that
85+
generator context manager will indicate to the :keyword:`!with` statement that
8686
the exception has been handled, and execution will resume with the statement
87-
immediately following the :keyword:`with` statement.
87+
immediately following the :keyword:`!with` statement.
8888

8989
:func:`contextmanager` uses :class:`ContextDecorator` so the context managers
9090
it creates can be used as decorators as well as in :keyword:`with` statements.
@@ -346,7 +346,7 @@ Functions and classes provided:
346346
As the decorated function must be able to be called multiple times, the
347347
underlying context manager must support use in multiple :keyword:`with`
348348
statements. If this is not the case, then the original construct with the
349-
explicit :keyword:`with` statement inside the function should be used.
349+
explicit :keyword:`!with` statement inside the function should be used.
350350

351351
.. versionadded:: 3.2
352352

@@ -771,7 +771,7 @@ Reentrant context managers
771771

772772
More sophisticated context managers may be "reentrant". These context
773773
managers can not only be used in multiple :keyword:`with` statements,
774-
but may also be used *inside* a :keyword:`with` statement that is already
774+
but may also be used *inside* a :keyword:`!with` statement that is already
775775
using the same context manager.
776776

777777
:class:`threading.RLock` is an example of a reentrant context manager, as are

Doc/library/fileinput.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ The following function is the primary interface of this module:
6363

6464
The :class:`FileInput` instance can be used as a context manager in the
6565
:keyword:`with` statement. In this example, *input* is closed after the
66-
:keyword:`with` statement is exited, even if an exception occurs::
66+
:keyword:`!with` statement is exited, even if an exception occurs::
6767

6868
with fileinput.input(files=('spam.txt', 'eggs.txt')) as f:
6969
for line in f:
@@ -155,7 +155,7 @@ available for subclassing as well:
155155

156156
A :class:`FileInput` instance can be used as a context manager in the
157157
:keyword:`with` statement. In this example, *input* is closed after the
158-
:keyword:`with` statement is exited, even if an exception occurs::
158+
:keyword:`!with` statement is exited, even if an exception occurs::
159159

160160
with FileInput(files=('spam.txt', 'eggs.txt')) as input:
161161
process(input)

Doc/library/functions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1665,7 +1665,7 @@ are always available. They are listed here in alphabetical order.
16651665
This function is invoked by the :keyword:`import` statement. It can be
16661666
replaced (by importing the :mod:`builtins` module and assigning to
16671667
``builtins.__import__``) in order to change semantics of the
1668-
:keyword:`import` statement, but doing so is **strongly** discouraged as it
1668+
:keyword:`!import` statement, but doing so is **strongly** discouraged as it
16691669
is usually simpler to use import hooks (see :pep:`302`) to attain the same
16701670
goals and does not cause issues with code which assumes the default import
16711671
implementation is in use. Direct use of :func:`__import__` is also

Doc/library/imaplib.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ base class:
3939

4040
The :class:`IMAP4` class supports the :keyword:`with` statement. When used
4141
like this, the IMAP4 ``LOGOUT`` command is issued automatically when the
42-
:keyword:`with` statement exits. E.g.::
42+
:keyword:`!with` statement exits. E.g.::
4343

4444
>>> from imaplib import IMAP4
4545
>>> with IMAP4("domain.org") as M:

Doc/library/imp.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ This module provides an interface to the mechanisms used to implement the
179179
If a module imports objects from another module using :keyword:`from` ...
180180
:keyword:`import` ..., calling :func:`reload` for the other module does not
181181
redefine the objects imported from it --- one way around this is to re-execute
182-
the :keyword:`from` statement, another is to use :keyword:`import` and qualified
182+
the :keyword:`!from` statement, another is to use :keyword:`!import` and qualified
183183
names (*module*.*name*) instead.
184184

185185
If a module instantiates instances of a class, reloading the module that defines

Doc/library/importlib.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
:mod:`importlib` --- The implementation of :keyword:`import`
2-
============================================================
1+
:mod:`!importlib` --- The implementation of :keyword:`!import`
2+
==============================================================
33

44
.. module:: importlib
55
:synopsis: The implementation of the import machinery.
@@ -19,7 +19,7 @@ Introduction
1919
The purpose of the :mod:`importlib` package is two-fold. One is to provide the
2020
implementation of the :keyword:`import` statement (and thus, by extension, the
2121
:func:`__import__` function) in Python source code. This provides an
22-
implementation of :keyword:`import` which is portable to any Python
22+
implementation of :keyword:`!import` which is portable to any Python
2323
interpreter. This also provides an implementation which is easier to
2424
comprehend than one implemented in a programming language other than Python.
2525

@@ -197,7 +197,7 @@ Functions
197197
If a module imports objects from another module using :keyword:`from` ...
198198
:keyword:`import` ..., calling :func:`reload` for the other module does not
199199
redefine the objects imported from it --- one way around this is to
200-
re-execute the :keyword:`from` statement, another is to use :keyword:`import`
200+
re-execute the :keyword:`!from` statement, another is to use :keyword:`!import`
201201
and qualified names (*module.name*) instead.
202202

203203
If a module instantiates instances of a class, reloading the module that

0 commit comments

Comments
 (0)