@@ -151,9 +151,9 @@ Glossary
151151 A :term: `file object ` able to read and write
152152 :term: `bytes-like objects <bytes-like object> `.
153153 Examples of binary files are files opened in binary mode (``'rb' ``,
154- ``'wb' `` or ``'rb+' ``), :data: `sys.stdin.buffer `,
155- :data: `sys.stdout.buffer `, and instances of :class: ` io.BytesIO ` and
156- :class: `gzip.GzipFile `.
154+ ``'wb' `` or ``'rb+' ``), :data: `sys.stdin.buffer <sys.stdin> `,
155+ :data: `sys.stdout.buffer <sys.stdout> `, and instances of
156+ :class: `io.BytesIO ` and :class: ` gzip.GzipFile `.
157157
158158 See also :term: `text file ` for a file object able to read and write
159159 :class: `str ` objects.
@@ -304,8 +304,9 @@ Glossary
304304 :ref: `class definitions <class >` for more about decorators.
305305
306306 descriptor
307- Any object which defines the methods :meth: `__get__ `, :meth: `__set__ `, or
308- :meth: `__delete__ `. When a class attribute is a descriptor, its special
307+ Any object which defines the methods :meth: `~object.__get__ `,
308+ :meth: `~object.__set__ `, or :meth: `~object.__delete__ `.
309+ When a class attribute is a descriptor, its special
309310 binding behavior is triggered upon attribute lookup. Normally, using
310311 *a.b * to get, set or delete an attribute looks up the object named *b * in
311312 the class dictionary for *a *, but if *b * is a descriptor, the respective
@@ -319,7 +320,8 @@ Glossary
319320
320321 dictionary
321322 An associative array, where arbitrary keys are mapped to values. The
322- keys can be any object with :meth: `__hash__ ` and :meth: `__eq__ ` methods.
323+ keys can be any object with :meth: `~object.__hash__ ` and
324+ :meth: `~object.__eq__ ` methods.
323325 Called a hash in Perl.
324326
325327 dictionary comprehension
@@ -383,7 +385,7 @@ Glossary
383385
384386 file object
385387 An object exposing a file-oriented API (with methods such as
386- :meth: `read() ` or :meth: `write() `) to an underlying resource. Depending
388+ :meth: `! read ` or :meth: `! write `) to an underlying resource. Depending
387389 on the way it was created, a file object can mediate access to a real
388390 on-disk file or to another type of storage or communication device
389391 (for example standard input/output, in-memory buffers, sockets, pipes,
@@ -559,8 +561,9 @@ Glossary
559561
560562 hashable
561563 An object is *hashable * if it has a hash value which never changes during
562- its lifetime (it needs a :meth: `__hash__ ` method), and can be compared to
563- other objects (it needs an :meth: `__eq__ ` method). Hashable objects which
564+ its lifetime (it needs a :meth: `~object.__hash__ ` method), and can be
565+ compared to other objects (it needs an :meth: `~object.__eq__ ` method).
566+ Hashable objects which
564567 compare equal must have the same hash value.
565568
566569 Hashability makes an object usable as a dictionary key and a set member,
@@ -646,7 +649,8 @@ Glossary
646649 iterables include all sequence types (such as :class: `list `, :class: `str `,
647650 and :class: `tuple `) and some non-sequence types like :class: `dict `,
648651 :term: `file objects <file object> `, and objects of any classes you define
649- with an :meth: `__iter__ ` method or with a :meth: `~object.__getitem__ ` method
652+ with an :meth: `~iterator.__iter__ ` method or with a
653+ :meth: `~object.__getitem__ ` method
650654 that implements :term: `sequence ` semantics.
651655
652656 Iterables can be
@@ -655,7 +659,7 @@ Glossary
655659 as an argument to the built-in function :func: `iter `, it returns an
656660 iterator for the object. This iterator is good for one pass over the set
657661 of values. When using iterables, it is usually not necessary to call
658- :func: `iter ` or deal with iterator objects yourself. The `` for ` `
662+ :func: `iter ` or deal with iterator objects yourself. The :keyword: ` for `
659663 statement does that automatically for you, creating a temporary unnamed
660664 variable to hold the iterator for the duration of the loop. See also
661665 :term: `iterator `, :term: `sequence `, and :term: `generator `.
@@ -666,8 +670,8 @@ Glossary
666670 :func: `next `) return successive items in the stream. When no more data
667671 are available a :exc: `StopIteration ` exception is raised instead. At this
668672 point, the iterator object is exhausted and any further calls to its
669- :meth: `__next__ ` method just raise :exc: `StopIteration ` again. Iterators
670- are required to have an :meth: `__iter__ ` method that returns the iterator
673+ :meth: `! __next__ ` method just raise :exc: `StopIteration ` again. Iterators
674+ are required to have an :meth: `~iterator. __iter__ ` method that returns the iterator
671675 object itself so every iterator is also iterable and may be used in most
672676 places where other iterables are accepted. One notable exception is code
673677 which attempts multiple iteration passes. A container object (such as a
@@ -681,7 +685,7 @@ Glossary
681685 .. impl-detail ::
682686
683687 CPython does not consistently apply the requirement that an iterator
684- define :meth: `__iter__ `.
688+ define :meth: `~iterator. __iter__ `.
685689
686690 key function
687691 A key function or collation function is a callable that returns a value
@@ -875,7 +879,8 @@ Glossary
875879 Old name for the flavor of classes now used for all class objects. In
876880 earlier Python versions, only new-style classes could use Python's newer,
877881 versatile features like :attr: `~object.__slots__ `, descriptors,
878- properties, :meth: `__getattribute__ `, class methods, and static methods.
882+ properties, :meth: `~object.__getattribute__ `, class methods, and static
883+ methods.
879884
880885 object
881886 Any data with state (attributes or value) and defined behavior
@@ -955,7 +960,7 @@ Glossary
955960 finders implement.
956961
957962 path entry hook
958- A callable on the :data: `sys.path_hook ` list which returns a :term: `path
963+ A callable on the :data: `sys.path_hooks ` list which returns a :term: `path
959964 entry finder ` if it knows how to find modules on a specific :term: `path
960965 entry `.
961966
@@ -1089,18 +1094,18 @@ Glossary
10891094 sequence
10901095 An :term: `iterable ` which supports efficient element access using integer
10911096 indices via the :meth: `~object.__getitem__ ` special method and defines a
1092- :meth: `__len__ ` method that returns the length of the sequence.
1097+ :meth: `~object. __len__ ` method that returns the length of the sequence.
10931098 Some built-in sequence types are :class: `list `, :class: `str `,
10941099 :class: `tuple `, and :class: `bytes `. Note that :class: `dict ` also
1095- supports :meth: `~object.__getitem__ ` and :meth: `__len__ `, but is considered a
1100+ supports :meth: `~object.__getitem__ ` and :meth: `! __len__ `, but is considered a
10961101 mapping rather than a sequence because the lookups use arbitrary
10971102 :term: `immutable ` keys rather than integers.
10981103
10991104 The :class: `collections.abc.Sequence ` abstract base class
11001105 defines a much richer interface that goes beyond just
1101- :meth: `~object.__getitem__ ` and :meth: `__len__ `, adding :meth: ` count `,
1102- :meth: `index `, :meth: `__contains__ `, and
1103- :meth: `__reversed__ `. Types that implement this expanded
1106+ :meth: `~object.__getitem__ ` and :meth: `~object. __len__ `, adding
1107+ :meth: `count `, :meth: ` index `, :meth: `~object. __contains__ `, and
1108+ :meth: `~object. __reversed__ `. Types that implement this expanded
11041109 interface can be registered explicitly using
11051110 :func: `~abc.ABCMeta.register `.
11061111
0 commit comments