@@ -160,9 +160,9 @@ Glossary
160160 A :term: `file object ` able to read and write
161161 :term: `bytes-like objects <bytes-like object> `.
162162 Examples of binary files are files opened in binary mode (``'rb' ``,
163- ``'wb' `` or ``'rb+' ``), :data: `sys.stdin.buffer `,
164- :data: `sys.stdout.buffer `, and instances of :class: ` io.BytesIO ` and
165- :class: `gzip.GzipFile `.
163+ ``'wb' `` or ``'rb+' ``), :data: `sys.stdin.buffer <sys.stdin> `,
164+ :data: `sys.stdout.buffer <sys.stdout> `, and instances of
165+ :class: `io.BytesIO ` and :class: ` gzip.GzipFile `.
166166
167167 See also :term: `text file ` for a file object able to read and write
168168 :class: `str ` objects.
@@ -313,8 +313,9 @@ Glossary
313313 :ref: `class definitions <class >` for more about decorators.
314314
315315 descriptor
316- Any object which defines the methods :meth: `__get__ `, :meth: `__set__ `, or
317- :meth: `__delete__ `. When a class attribute is a descriptor, its special
316+ Any object which defines the methods :meth: `~object.__get__ `,
317+ :meth: `~object.__set__ `, or :meth: `~object.__delete__ `.
318+ When a class attribute is a descriptor, its special
318319 binding behavior is triggered upon attribute lookup. Normally, using
319320 *a.b * to get, set or delete an attribute looks up the object named *b * in
320321 the class dictionary for *a *, but if *b * is a descriptor, the respective
@@ -328,7 +329,8 @@ Glossary
328329
329330 dictionary
330331 An associative array, where arbitrary keys are mapped to values. The
331- keys can be any object with :meth: `__hash__ ` and :meth: `__eq__ ` methods.
332+ keys can be any object with :meth: `~object.__hash__ ` and
333+ :meth: `~object.__eq__ ` methods.
332334 Called a hash in Perl.
333335
334336 dictionary comprehension
@@ -392,7 +394,7 @@ Glossary
392394
393395 file object
394396 An object exposing a file-oriented API (with methods such as
395- :meth: `read() ` or :meth: `write() `) to an underlying resource. Depending
397+ :meth: `! read ` or :meth: `! write `) to an underlying resource. Depending
396398 on the way it was created, a file object can mediate access to a real
397399 on-disk file or to another type of storage or communication device
398400 (for example standard input/output, in-memory buffers, sockets, pipes,
@@ -568,8 +570,9 @@ Glossary
568570
569571 hashable
570572 An object is *hashable * if it has a hash value which never changes during
571- its lifetime (it needs a :meth: `__hash__ ` method), and can be compared to
572- other objects (it needs an :meth: `__eq__ ` method). Hashable objects which
573+ its lifetime (it needs a :meth: `~object.__hash__ ` method), and can be
574+ compared to other objects (it needs an :meth: `~object.__eq__ ` method).
575+ Hashable objects which
573576 compare equal must have the same hash value.
574577
575578 Hashability makes an object usable as a dictionary key and a set member,
@@ -645,7 +648,8 @@ Glossary
645648 iterables include all sequence types (such as :class: `list `, :class: `str `,
646649 and :class: `tuple `) and some non-sequence types like :class: `dict `,
647650 :term: `file objects <file object> `, and objects of any classes you define
648- with an :meth: `__iter__ ` method or with a :meth: `~object.__getitem__ ` method
651+ with an :meth: `~iterator.__iter__ ` method or with a
652+ :meth: `~object.__getitem__ ` method
649653 that implements :term: `sequence ` semantics.
650654
651655 Iterables can be
@@ -654,7 +658,7 @@ Glossary
654658 as an argument to the built-in function :func: `iter `, it returns an
655659 iterator for the object. This iterator is good for one pass over the set
656660 of values. When using iterables, it is usually not necessary to call
657- :func: `iter ` or deal with iterator objects yourself. The `` for ` `
661+ :func: `iter ` or deal with iterator objects yourself. The :keyword: ` for `
658662 statement does that automatically for you, creating a temporary unnamed
659663 variable to hold the iterator for the duration of the loop. See also
660664 :term: `iterator `, :term: `sequence `, and :term: `generator `.
@@ -665,8 +669,8 @@ Glossary
665669 :func: `next `) return successive items in the stream. When no more data
666670 are available a :exc: `StopIteration ` exception is raised instead. At this
667671 point, the iterator object is exhausted and any further calls to its
668- :meth: `__next__ ` method just raise :exc: `StopIteration ` again. Iterators
669- are required to have an :meth: `__iter__ ` method that returns the iterator
672+ :meth: `! __next__ ` method just raise :exc: `StopIteration ` again. Iterators
673+ are required to have an :meth: `~iterator. __iter__ ` method that returns the iterator
670674 object itself so every iterator is also iterable and may be used in most
671675 places where other iterables are accepted. One notable exception is code
672676 which attempts multiple iteration passes. A container object (such as a
@@ -680,7 +684,7 @@ Glossary
680684 .. impl-detail ::
681685
682686 CPython does not consistently apply the requirement that an iterator
683- define :meth: `__iter__ `.
687+ define :meth: `~iterator. __iter__ `.
684688
685689 key function
686690 A key function or collation function is a callable that returns a value
@@ -874,7 +878,8 @@ Glossary
874878 Old name for the flavor of classes now used for all class objects. In
875879 earlier Python versions, only new-style classes could use Python's newer,
876880 versatile features like :attr: `~object.__slots__ `, descriptors,
877- properties, :meth: `__getattribute__ `, class methods, and static methods.
881+ properties, :meth: `~object.__getattribute__ `, class methods, and static
882+ methods.
878883
879884 object
880885 Any data with state (attributes or value) and defined behavior
@@ -954,7 +959,7 @@ Glossary
954959 finders implement.
955960
956961 path entry hook
957- A callable on the :data: `sys.path_hook ` list which returns a :term: `path
962+ A callable on the :data: `sys.path_hooks ` list which returns a :term: `path
958963 entry finder ` if it knows how to find modules on a specific :term: `path
959964 entry `.
960965
@@ -1088,18 +1093,18 @@ Glossary
10881093 sequence
10891094 An :term: `iterable ` which supports efficient element access using integer
10901095 indices via the :meth: `~object.__getitem__ ` special method and defines a
1091- :meth: `__len__ ` method that returns the length of the sequence.
1096+ :meth: `~object. __len__ ` method that returns the length of the sequence.
10921097 Some built-in sequence types are :class: `list `, :class: `str `,
10931098 :class: `tuple `, and :class: `bytes `. Note that :class: `dict ` also
1094- supports :meth: `~object.__getitem__ ` and :meth: `__len__ `, but is considered a
1099+ supports :meth: `~object.__getitem__ ` and :meth: `! __len__ `, but is considered a
10951100 mapping rather than a sequence because the lookups use arbitrary
10961101 :term: `immutable ` keys rather than integers.
10971102
10981103 The :class: `collections.abc.Sequence ` abstract base class
10991104 defines a much richer interface that goes beyond just
1100- :meth: `~object.__getitem__ ` and :meth: `__len__ `, adding :meth: ` count `,
1101- :meth: `index `, :meth: `__contains__ `, and
1102- :meth: `__reversed__ `. Types that implement this expanded
1105+ :meth: `~object.__getitem__ ` and :meth: `~object. __len__ `, adding
1106+ :meth: `count `, :meth: ` index `, :meth: `~object. __contains__ `, and
1107+ :meth: `~object. __reversed__ `. Types that implement this expanded
11031108 interface can be registered explicitly using
11041109 :func: `~abc.ABCMeta.register `.
11051110
0 commit comments