Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d7d3690

Browse files
[3.11] gh-108731: Add description of __slots__ to MemberDescriptorType docs (GH-108745) (GH-114537)
(cherry picked from commit 6888ccc) Co-authored-by: plokmijnuhby <[email protected]>
1 parent 94c5567 commit d7d3690

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Doc/library/types.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,10 @@ Standard names are defined for the following types:
356356
data members which use standard conversion functions; it has the same purpose
357357
as the :class:`property` type, but for classes defined in extension modules.
358358

359+
In addition, when a class is defined with a :attr:`~object.__slots__` attribute, then for
360+
each slot, an instance of :class:`!MemberDescriptorType` will be added as an attribute
361+
on the class. This allows the slot to appear in the class's :attr:`~object.__dict__`.
362+
359363
.. impl-detail::
360364

361365
In other implementations of Python, this type may be identical to

0 commit comments

Comments
 (0)