Skip to content

Commit 53b1682

Browse files
committed
Tweaks
1 parent 3c96755 commit 53b1682

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

Doc/whatsnew/2.6.rst

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ The :mod:`threading` module's locks and condition variables also support the
307307
The lock is acquired before the block is executed and always released once the
308308
block is complete.
309309

310-
The :func:`decimal.localcontext` function in the :mod:`decimal` module makes
310+
The :func:`~decimal.localcontext` function in the :mod:`decimal` module makes
311311
it easy to save and restore the current decimal context, which encapsulates
312312
the desired precision and rounding characteristics for computations::
313313

@@ -378,7 +378,7 @@ be to let the user write code like this::
378378

379379
The transaction should be committed if the code in the block runs flawlessly or
380380
rolled back if there's an exception. Here's the basic interface for
381-
``DatabaseConnection`` that I'll assume::
381+
:class:`!DatabaseConnection` that I'll assume::
382382

383383
class DatabaseConnection:
384384
# Database interface
@@ -627,7 +627,8 @@ Two other classes, :class:`~multiprocessing.pool.Pool` and
627627
processes, and requests can then be distributed to the workers by calling
628628
:meth:`~multiprocessing.pool.Pool.apply` or
629629
:meth:`~multiprocessing.pool.Pool.apply_async` to add a single request, and
630-
:meth:`map` or :meth:`~multiprocessing.pool.Pool.map_async` to add a number of
630+
:meth:`~multiprocessing.pool.Pool.map` or
631+
:meth:`~multiprocessing.pool.Pool.map_async` to add a number of
631632
requests. The following code uses a :class:`~multiprocessing.pool.Pool` to
632633
spread requests across 5 worker processes and retrieve a list of results::
633634

@@ -831,7 +832,7 @@ documentation for a :ref:`complete list <formatstrings>`; here's a sample:
831832
format, followed by a percent sign.
832833
===== ========================================================================
833834

834-
Classes and types can define a ``__format__`` method to control how they're
835+
Classes and types can define a :meth:`~object.__format__` method to control how they're
835836
formatted. It receives a single argument, the format specifier::
836837

837838
def __format__(self, format_spec):
@@ -841,7 +842,7 @@ formatted. It receives a single argument, the format specifier::
841842
return str(self)
842843

843844
There's also a :func:`format` builtin that will format a single
844-
value. It calls the type's ``__format__`` method with the
845+
value. It calls the type's :meth:`~object.__format__` method with the
845846
provided specifier::
846847

847848
>>> format(75.6564, '.2f')
@@ -1036,8 +1037,8 @@ PEP 3116: New I/O Library
10361037

10371038
Python's built-in file objects support a number of methods, but
10381039
file-like objects don't necessarily support all of them. Objects that
1039-
imitate files usually support :meth:`~io.TextIOBase.read` and
1040-
:meth:`~io.TextIOBase.write`, but they may not support :meth:`readline`,
1040+
imitate files usually support :meth:`!read` and
1041+
:meth:`!write`, but they may not support :meth:`!readline`,
10411042
for example. Python 3.0 introduces a layered I/O library in the :mod:`io`
10421043
module that separates buffering and text-handling features from the
10431044
fundamental read and write operations.
@@ -1265,16 +1266,16 @@ metaclass in a class definition::
12651266
...
12661267

12671268

1268-
In the ``Drawable`` ABC above, the ``draw_doubled`` method
1269+
In the :class:`!Drawable` ABC above, the :meth:`!draw_doubled` method
12691270
renders the object at twice its size and can be implemented in terms
1270-
of other methods described in ``Drawable``. Classes implementing
1271+
of other methods described in :class:`!Drawable`. Classes implementing
12711272
this ABC therefore don't need to provide their own implementation
1272-
of ``draw_doubled``, though they can do so. An implementation
1273-
of ``draw`` is necessary, though; the ABC can't provide
1273+
of :meth:`!draw_doubled`, though they can do so. An implementation
1274+
of :meth:`!draw` is necessary, though; the ABC can't provide
12741275
a useful generic implementation.
12751276

1276-
You can apply the :func:`~abc.abstractmethod` decorator to methods such as
1277-
``draw`` that must be implemented; Python will then raise an
1277+
You can apply the :deco:`~abc.abstractmethod` decorator to methods such as
1278+
:meth:`!draw` that must be implemented; Python will then raise an
12781279
exception for classes that don't define the method.
12791280
Note that the exception is only raised when you actually
12801281
try to create an instance of a subclass lacking the method::

0 commit comments

Comments
 (0)