Skip to content

Commit 03605c4

Browse files
committed
Make example code reference literals for DatabaseConnection and Drawable
Also add a working link for abc.abstractmethod while there
1 parent d8f9ee0 commit 03605c4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Doc/whatsnew/2.6.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
:class:`DatabaseConnection` that I'll assume::
381+
``DatabaseConnection`` that I'll assume::
382382

383383
class DatabaseConnection:
384384
# Database interface
@@ -1256,16 +1256,16 @@ metaclass in a class definition::
12561256
...
12571257

12581258

1259-
In the :class:`Drawable` ABC above, the :meth:`draw_doubled` method
1259+
In the ``Drawable`` ABC above, the ``draw_doubled`` method
12601260
renders the object at twice its size and can be implemented in terms
1261-
of other methods described in :class:`Drawable`. Classes implementing
1261+
of other methods described in ``Drawable``. Classes implementing
12621262
this ABC therefore don't need to provide their own implementation
1263-
of :meth:`draw_doubled`, though they can do so. An implementation
1264-
of :meth:`draw` is necessary, though; the ABC can't provide
1263+
of ``draw_doubled``, though they can do so. An implementation
1264+
of ``draw`` is necessary, though; the ABC can't provide
12651265
a useful generic implementation.
12661266

1267-
You can apply the ``@abstractmethod`` decorator to methods such as
1268-
:meth:`draw` that must be implemented; Python will then raise an
1267+
You can apply the :func:`~abc.abstractmethod` decorator to methods such as
1268+
``draw`` that must be implemented; Python will then raise an
12691269
exception for classes that don't define the method.
12701270
Note that the exception is only raised when you actually
12711271
try to create an instance of a subclass lacking the method::
@@ -1289,7 +1289,7 @@ Abstract data attributes can be declared using the
12891289
def readonly(self):
12901290
return self._x
12911291

1292-
Subclasses must then define a :meth:`readonly` property.
1292+
Subclasses must then define a ``readonly`` property.
12931293

12941294
.. seealso::
12951295

0 commit comments

Comments
 (0)