Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood committed Sep 25, 2024
1 parent e61ac8d commit fbfe927
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Doc/c-api/object.rst
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ Object Protocol
is an instance of *cls* if its class is a subclass of *cls*.
An instance *inst* can override what is considered its class by having a
:attr:`~instance.__class__` attribute.
:attr:`~object.__class__` attribute.
An object *cls* can override if it is considered a class, and what its base
classes are, by having a :attr:`~class.__bases__` attribute (which must be a tuple
Expand Down
2 changes: 1 addition & 1 deletion Doc/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ Glossary
type
The type of a Python object determines what kind of object it is; every
object has a type. An object's type is accessible as its
:attr:`~instance.__class__` attribute or can be retrieved with
:attr:`~object.__class__` attribute or can be retrieved with
``type(obj)``.

type alias
Expand Down
2 changes: 1 addition & 1 deletion Doc/library/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2048,7 +2048,7 @@ are always available. They are listed here in alphabetical order.

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

The :func:`isinstance` built-in function is recommended for testing the type
of an object, because it takes subclasses into account.
Expand Down
8 changes: 4 additions & 4 deletions Doc/library/functools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -742,10 +742,10 @@ have three read-only attributes:
The keyword arguments that will be supplied when the :class:`partial` object is
called.

:class:`partial` objects are like :class:`function` objects in that they are
callable, weak referenceable, and can have attributes. There are some important
differences. For instance, the :attr:`~function.__name__` and
:attr:`function.__doc__` attributes
:class:`partial` objects are like :ref:`function objects <user-defined-funcs>`
in that they are callable, weak referenceable, and can have attributes.
There are some important differences. For instance, the
:attr:`~function.__name__` and :attr:`function.__doc__` attributes
are not created automatically. Also, :class:`partial` objects defined in
classes behave like static methods and do not transform into bound methods
during instance attribute look-up.
2 changes: 1 addition & 1 deletion Doc/library/unittest.mock.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ the *new_callable* argument to :func:`patch`.
Accessing any attribute not in this list will raise an :exc:`AttributeError`.

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

* *spec_set*: A stricter variant of *spec*. If used, attempting to *set*
Expand Down
4 changes: 2 additions & 2 deletions Doc/reference/datamodel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ have the following two methods available:
.. doctest::

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

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

* :attr:`~instance.__class__` assignment works only if both classes have the
* :attr:`~object.__class__` assignment works only if both classes have the
same *__slots__*.

* :ref:`Multiple inheritance <tut-multiple>` with multiple slotted parent
Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/2.3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ Here are all of the changes that Python 2.3 makes to the core Python language.
removed: you can now assign to the :attr:`~class.__name__` and :attr:`~class.__bases__`
attributes of new-style classes. There are some restrictions on what can be
assigned to :attr:`!__bases__` along the lines of those relating to assigning to
an instance's :attr:`~instance.__class__` attribute.
an instance's :attr:`~object.__class__` attribute.

.. ======================================================================
Expand Down

0 comments on commit fbfe927

Please sign in to comment.