Skip to content

Commit fbfe927

Browse files
committed
Fixes
1 parent e61ac8d commit fbfe927

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

Doc/c-api/object.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ Object Protocol
391391
is an instance of *cls* if its class is a subclass of *cls*.
392392
393393
An instance *inst* can override what is considered its class by having a
394-
:attr:`~instance.__class__` attribute.
394+
:attr:`~object.__class__` attribute.
395395
396396
An object *cls* can override if it is considered a class, and what its base
397397
classes are, by having a :attr:`~class.__bases__` attribute (which must be a tuple

Doc/glossary.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,7 @@ Glossary
12411241
type
12421242
The type of a Python object determines what kind of object it is; every
12431243
object has a type. An object's type is accessible as its
1244-
:attr:`~instance.__class__` attribute or can be retrieved with
1244+
:attr:`~object.__class__` attribute or can be retrieved with
12451245
``type(obj)``.
12461246

12471247
type alias

Doc/library/functions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2048,7 +2048,7 @@ are always available. They are listed here in alphabetical order.
20482048

20492049
With one argument, return the type of an *object*. The return value is a
20502050
type object and generally the same object as returned by
2051-
:attr:`object.__class__ <instance.__class__>`.
2051+
:attr:`object.__class__`.
20522052

20532053
The :func:`isinstance` built-in function is recommended for testing the type
20542054
of an object, because it takes subclasses into account.

Doc/library/functools.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -742,10 +742,10 @@ have three read-only attributes:
742742
The keyword arguments that will be supplied when the :class:`partial` object is
743743
called.
744744

745-
:class:`partial` objects are like :class:`function` objects in that they are
746-
callable, weak referenceable, and can have attributes. There are some important
747-
differences. For instance, the :attr:`~function.__name__` and
748-
:attr:`function.__doc__` attributes
745+
:class:`partial` objects are like :ref:`function objects <user-defined-funcs>`
746+
in that they are callable, weak referenceable, and can have attributes.
747+
There are some important differences. For instance, the
748+
:attr:`~function.__name__` and :attr:`function.__doc__` attributes
749749
are not created automatically. Also, :class:`partial` objects defined in
750750
classes behave like static methods and do not transform into bound methods
751751
during instance attribute look-up.

Doc/library/unittest.mock.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ the *new_callable* argument to :func:`patch`.
239239
Accessing any attribute not in this list will raise an :exc:`AttributeError`.
240240

241241
If *spec* is an object (rather than a list of strings) then
242-
:attr:`~instance.__class__` returns the class of the spec object. This
242+
:attr:`~object.__class__` returns the class of the spec object. This
243243
allows mocks to pass :func:`isinstance` tests.
244244

245245
* *spec_set*: A stricter variant of *spec*. If used, attempting to *set*

Doc/reference/datamodel.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ have the following two methods available:
11061106
.. doctest::
11071107

11081108
>>> int.__subclasses__()
1109-
[<class 'bool'>, <enum 'IntEnum'>, <flag 'IntFlag'>, <class 're._constants._NamedIntConstant'>]
1109+
[<class 'bool'>, <enum 'IntEnum'>, <flag 'IntFlag'>, <class 're._constants._NamedIntConstant'>, <class 're._ZeroSentinel'>]
11101110

11111111
Class instances
11121112
---------------
@@ -2412,7 +2412,7 @@ Notes on using *__slots__*:
24122412
to provide per-attribute docstrings that will be recognised by
24132413
:func:`inspect.getdoc` and displayed in the output of :func:`help`.
24142414

2415-
* :attr:`~instance.__class__` assignment works only if both classes have the
2415+
* :attr:`~object.__class__` assignment works only if both classes have the
24162416
same *__slots__*.
24172417

24182418
* :ref:`Multiple inheritance <tut-multiple>` with multiple slotted parent

Doc/whatsnew/2.3.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,7 @@ Here are all of the changes that Python 2.3 makes to the core Python language.
11161116
removed: you can now assign to the :attr:`~class.__name__` and :attr:`~class.__bases__`
11171117
attributes of new-style classes. There are some restrictions on what can be
11181118
assigned to :attr:`!__bases__` along the lines of those relating to assigning to
1119-
an instance's :attr:`~instance.__class__` attribute.
1119+
an instance's :attr:`~object.__class__` attribute.
11201120

11211121
.. ======================================================================
11221122

0 commit comments

Comments
 (0)