]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-108731: Add description of __slots__ to MemberDescriptorType docs (GH-108745)
authorplokmijnuhby <39633434+plokmijnuhby@users.noreply.github.com>
Wed, 24 Jan 2024 19:58:34 +0000 (19:58 +0000)
committerGitHub <noreply@github.com>
Wed, 24 Jan 2024 19:58:34 +0000 (21:58 +0200)
Doc/library/types.rst

index 8ce67cf77253c30681816e5dd11e4e3084db1fbd..c8c981024c1aeb11dd167ad49246de303b686db8 100644 (file)
@@ -398,6 +398,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