@@ -1162,7 +1162,7 @@ Some object-oriented languages such as Java support interfaces,
11621162declaring that a class has a given set of methods or supports a given
11631163access protocol. Abstract Base Classes (or ABCs) are an equivalent
11641164feature 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
11661166this metaclass by the :func: `isinstance ` and :func: `issubclass `
11671167builtins, and a collection of basic ABCs that the Python developers
11681168think 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
11721172dictionary-style access. The phrase "dictionary-style" is vague, however.
11731173It probably means that accessing items with ``obj[1] `` works.
11741174Does 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
11791179The Python 2.6 :mod: `collections ` module includes a number of
11801180different 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__ `
11831183method and therefore supports ``x in y `` expressions. The basic
11841184dictionary 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
11881188You can derive your own classes from a particular ABC
@@ -1196,7 +1196,7 @@ to indicate they support that ABC's interface::
11961196
11971197Alternatively, you could write the class without deriving from
11981198the 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
12081208For 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
12101210ABC that can describe an existing type or class, or if you want
12111211to 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,
12131213it's legal to do::
12141214
12151215 # Register Python's types
0 commit comments