Skip to content

Commit b47e279

Browse files
committed
Fix Abstract Base Classes references
1 parent 82dfad3 commit b47e279

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Doc/whatsnew/2.6.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,7 @@ Some object-oriented languages such as Java support interfaces,
11621162
declaring that a class has a given set of methods or supports a given
11631163
access protocol. Abstract Base Classes (or ABCs) are an equivalent
11641164
feature for Python. The ABC support consists of an :mod:`abc` module
1165-
containing a metaclass called :class:`ABCMeta`, special handling of
1165+
containing a metaclass called :class:`~abc.ABCMeta`, special handling of
11661166
this metaclass by the :func:`isinstance` and :func:`issubclass`
11671167
builtins, and a collection of basic ABCs that the Python developers
11681168
think will be widely useful. Future versions of Python will probably
@@ -1172,17 +1172,17 @@ Let's say you have a particular class and wish to know whether it supports
11721172
dictionary-style access. The phrase "dictionary-style" is vague, however.
11731173
It probably means that accessing items with ``obj[1]`` works.
11741174
Does it imply that setting items with ``obj[2] = value`` works?
1175-
Or that the object will have :meth:`keys`, :meth:`values`, and :meth:`items`
1176-
methods? What about the iterative variants such as :meth:`iterkeys`? :meth:`copy`
1177-
and :meth:`update`? Iterating over the object with :func:`iter`?
1175+
Or that the object will have :meth:`!keys`, :meth:`!values`, and :meth:`!items`
1176+
methods? What about the iterative variants such as :meth:`!iterkeys`? :meth:`!copy`
1177+
and :meth:`!update`? Iterating over the object with :func:`!iter`?
11781178

11791179
The Python 2.6 :mod:`collections` module includes a number of
11801180
different ABCs that represent these distinctions. :class:`Iterable`
1181-
indicates that a class defines :meth:`__iter__`, and
1182-
:class:`Container` means the class defines a :meth:`__contains__`
1181+
indicates that a class defines :meth:`~object.__iter__`, and
1182+
:class:`Container` means the class defines a :meth:`~object.__contains__`
11831183
method and therefore supports ``x in y`` expressions. The basic
11841184
dictionary interface of getting items, setting items, and
1185-
:meth:`keys`, :meth:`values`, and :meth:`items`, is defined by the
1185+
:meth:`!keys`, :meth:`!values`, and :meth:`!items`, is defined by the
11861186
:class:`MutableMapping` ABC.
11871187

11881188
You can derive your own classes from a particular ABC
@@ -1196,7 +1196,7 @@ to indicate they support that ABC's interface::
11961196

11971197
Alternatively, you could write the class without deriving from
11981198
the desired ABC and instead register the class by
1199-
calling the ABC's :meth:`register` method::
1199+
calling the ABC's :meth:`~abc.ABCMeta.register` method::
12001200

12011201
import collections
12021202

@@ -1206,10 +1206,10 @@ calling the ABC's :meth:`register` method::
12061206
collections.MutableMapping.register(Storage)
12071207

12081208
For classes that you write, deriving from the ABC is probably clearer.
1209-
The :meth:`register` method is useful when you've written a new
1209+
The :meth:`~abc.ABCMeta.register` method is useful when you've written a new
12101210
ABC that can describe an existing type or class, or if you want
12111211
to declare that some third-party class implements an ABC.
1212-
For example, if you defined a :class:`PrintableType` ABC,
1212+
For example, if you defined a :class:`!PrintableType` ABC,
12131213
it's legal to do::
12141214

12151215
# Register Python's types

0 commit comments

Comments
 (0)