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

Skip to content

Commit 6888ccc

Browse files
authored
gh-108731: Add description of __slots__ to MemberDescriptorType docs (GH-108745)
1 parent 191531f commit 6888ccc

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
@@ -398,6 +398,10 @@ Standard names are defined for the following types:
398398
data members which use standard conversion functions; it has the same purpose
399399
as the :class:`property` type, but for classes defined in extension modules.
400400

401+
In addition, when a class is defined with a :attr:`~object.__slots__` attribute, then for
402+
each slot, an instance of :class:`!MemberDescriptorType` will be added as an attribute
403+
on the class. This allows the slot to appear in the class's :attr:`~object.__dict__`.
404+
401405
.. impl-detail::
402406

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

0 commit comments

Comments
 (0)