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

Skip to content

Commit e122081

Browse files
[3.12] gh-108731: Add description of __slots__ to MemberDescriptorType docs (GH-108745) (GH-114536)
(cherry picked from commit 6888ccc) Co-authored-by: plokmijnuhby <[email protected]>
1 parent 66b7ae6 commit e122081

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

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

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

0 commit comments

Comments
 (0)