@@ -1942,7 +1942,8 @@ Basic customization
19421942 "informal" string representation of instances of that class is required.
19431943
19441944 This is typically used for debugging, so it is important that the representation
1945- is information-rich and unambiguous.
1945+ is information-rich and unambiguous. A default implementation is provided by the
1946+ :class: `object ` class itself.
19461947
19471948 ..index ::
19481949 single: string; __str__() (object method)
@@ -1952,10 +1953,10 @@ Basic customization
19521953
19531954..method ::object.__str__(self)
19541955
1955- Called by:func: `str(object) <str> ` and thebuilt-in functions
1956- :func: ` format ` and:func: `print ` to compute the "informal" or nicely
1956+ Called by:func: `str(object) <str> `, thedefault :meth: ` __format__ ` implementation,
1957+ andthe built-in function :func: `print `, to compute the "informal" or nicely
19571958 printable string representation of an object. The return value must be a
1958- :ref: `string <textseq >` object.
1959+ :ref: `str <textseq >` object.
19591960
19601961 This method differs from:meth: `object.__repr__ ` in that there is no
19611962 expectation that:meth: `__str__ ` return a valid Python expression: a more
@@ -1972,7 +1973,8 @@ Basic customization
19721973 ..index ::pair: built-in function; bytes
19731974
19741975 Called by:ref: `bytes <func-bytes >` to compute a byte-string representation
1975- of an object. This should return a:class: `bytes ` object.
1976+ of an object. This should return a:class: `bytes ` object. The:class: `object `
1977+ class itself does not provide this method.
19761978
19771979 ..index ::
19781980 single: string; __format__() (object method)
@@ -1996,6 +1998,9 @@ Basic customization
19961998
19971999 The return value must be a string object.
19982000
2001+ The default implementation by the:class: `object ` class should be given
2002+ an empty *format_spec * string. It delegates to:meth: `__str__ `.
2003+
19992004 ..versionchanged ::3.4
20002005 The __format__ method of ``object `` itself raises a:exc: `TypeError `
20012006 if passed any non-empty string.
@@ -2038,6 +2043,12 @@ Basic customization
20382043 ``(x<y or x==y) `` does not imply ``x<=y ``. To automatically generate ordering
20392044 operations from a single root operation, see:func: `functools.total_ordering `.
20402045
2046+ By default, the:class: `object ` class provides implementations consistent
2047+ with:ref: `expressions-value-comparisons `: equality compares according to
2048+ object identity, and order comparisons raise:exc: `TypeError `. Each default
2049+ method may generate these results directly, but may also return
2050+ :data: `NotImplemented `.
2051+
20412052 See the paragraph on:meth: `__hash__ ` for
20422053 some important notes on creating:term: `hashable ` objects which support
20432054 custom comparison operations and are usable as dictionary keys.
@@ -2093,9 +2104,9 @@ Basic customization
20932104 bucket).
20942105
20952106 User-defined classes have:meth: `__eq__ ` and:meth: `__hash__ ` methods
2096- by default; with them, all objects compare unequal (except with themselves)
2097- and ``x.__hash__() `` returns an appropriate value such that `` x == y ``
2098- implies both that ``x is y `` and ``hash(x) == hash(y) ``.
2107+ by default (inherited from the :class: ` object ` class) ; with them, all objects compare
2108+ unequal (except with themselves) and ``x.__hash__() `` returns an appropriate
2109+ value such that `` x == y `` implies both that ``x is y `` and ``hash(x) == hash(y) ``.
20992110
21002111 A class that overrides:meth: `__eq__ ` and does not define:meth: `__hash__ `
21012112 will have its:meth: `__hash__ ` implicitly set to ``None ``. When the
@@ -2145,8 +2156,8 @@ Basic customization
21452156 ``bool() ``; should return ``False `` or ``True ``. When this method is not
21462157 defined,:meth: `~object.__len__ ` is called, if it is defined, and the object is
21472158 considered true if its result is nonzero. If a class defines neither
2148- :meth: `!__len__ ` nor:meth: `!__bool__ `, all its instances are considered
2149- true.
2159+ :meth: `!__len__ ` nor:meth: `!__bool__ ` (which is true of the :class: ` object `
2160+ class itself), all its instances are considered true.
21502161
21512162
21522163.. _attribute-access :
@@ -2168,6 +2179,7 @@ access (use of, assignment to, or deletion of ``x.name``) for class instances.
21682179 for ``self ``; or:meth: `__get__ ` of a *name * property raises
21692180:exc: `AttributeError `). This method should either return the (computed)
21702181 attribute value or raise an:exc: `AttributeError ` exception.
2182+ The:class: `object ` class itself does not provide this method.
21712183
21722184 Note that if the attribute is found through the normal mechanism,
21732185:meth: `__getattr__ ` is not called. (This is an intentional asymmetry between
@@ -2306,8 +2318,8 @@ method (a so-called *descriptor* class) appears in an *owner* class (the
23062318descriptor must be in either the owner's class dictionary or in the class
23072319dictionary for one of its parents). In the examples below, "the attribute"
23082320refers to the attribute whose name is the key of the property in the owner
2309- class':attr: `~object.__dict__ `.
2310-
2321+ class':attr: `~object.__dict__ `. The :class: ` object ` class itself does not
2322+ implement any of these protocols.
23112323
23122324..method ::object.__get__(self, instance, owner=None)
23132325
@@ -2999,17 +3011,19 @@ Emulating callable objects
29993011
30003012 Called when the instance is "called" as a function; if this method is defined,
30013013 ``x(arg1, arg2, ...) `` roughly translates to ``type(x).__call__(x, arg1, ...) ``.
3014+ The:class: `object ` class itself does not provide this method.
30023015
30033016
30043017.. _sequence-types :
30053018
30063019Emulating container types
30073020-------------------------
30083021
3009- The following methods can be defined to implement container objects. Containers
3010- usually are:term: `sequences <sequence> ` (such as:class: `lists <list> ` or
3022+ The following methods can be defined to implement container objects. None of them
3023+ are provided by the:class: `object ` class itself. Containers usually are
3024+ :term: `sequences <sequence> ` (such as:class: `lists <list> ` or
30113025:class: `tuples <tuple> `) or:term: `mappings <mapping> ` (like
3012- :class : `dictionaries <dict > `),
3026+ :term : `dictionaries <dictionary > `),
30133027but can represent other containers as well. The first set of methods is used
30143028either to emulate a sequence or to emulate a mapping; the difference is that for
30153029a sequence, the allowable keys should be the integers *k * for which ``0 <= k <
@@ -3372,6 +3386,7 @@ Typical uses of context managers include saving and restoring various kinds of
33723386global state, locking and unlocking resources, closing opened files, etc.
33733387
33743388For more information on context managers, see:ref: `typecontextmanager `.
3389+ The:class: `object ` class itself does not provide the context manager methods.
33753390
33763391
33773392..method ::object.__enter__(self)
@@ -3576,6 +3591,8 @@ are awaitable.
35763591 Must return an:term: `iterator `. Should be used to implement
35773592:term: `awaitable ` objects. For instance,:class: `asyncio.Future ` implements
35783593 this method to be compatible with the:keyword: `await ` expression.
3594+ The:class: `object ` class itself is not awaitable and does not provide
3595+ this method.
35793596
35803597 ..note ::
35813598
@@ -3661,6 +3678,9 @@ its ``__anext__`` method.
36613678
36623679Asynchronous iterators can be used in an:keyword: `async for ` statement.
36633680
3681+ The:class: `object ` class itself does not provide these methods.
3682+
3683+
36643684..method ::object.__aiter__(self)
36653685
36663686 Must return an *asynchronous iterator * object.
@@ -3707,6 +3727,8 @@ suspend execution in its ``__aenter__`` and ``__aexit__`` methods.
37073727
37083728Asynchronous context managers can be used in an:keyword: `async with ` statement.
37093729
3730+ The:class: `object ` class itself does not provide these methods.
3731+
37103732..method ::object.__aenter__(self)
37113733
37123734 Semantically similar to:meth: `~object.__enter__ `, the only