]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-108731: Add description of __slots__ to MemberDescriptorType docs (GH-10874...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 24 Jan 2024 20:05:12 +0000 (21:05 +0100)
committerGitHub <noreply@github.com>
Wed, 24 Jan 2024 20:05:12 +0000 (20:05 +0000)
(cherry picked from commit 6888cccac0776d965cc38a7240e1bdbacb952b91)

Co-authored-by: plokmijnuhby <39633434+plokmijnuhby@users.noreply.github.com>
Doc/library/types.rst

index da10cf1d33e62116c8c9f79d11ee1e6dbfef1a6b..4f468da8a1f6f608ccf1a0785d13954ce5d3eb34 100644 (file)
@@ -356,6 +356,10 @@ Standard names are defined for the following types:
    data members which use standard conversion functions; it has the same purpose
    as the :class:`property` type, but for classes defined in extension modules.
 
+   In addition, when a class is defined with a :attr:`~object.__slots__` attribute, then for
+   each slot, an instance of :class:`!MemberDescriptorType` will be added as an attribute
+   on the class. This allows the slot to appear in the class's :attr:`~object.__dict__`.
+
    .. impl-detail::
 
       In other implementations of Python, this type may be identical to