Skip to content

Commit 2dd55e0

Browse files
committed
__slots__ to implementation details
1 parent 4e7913f commit 2dd55e0

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Doc/reference/compound_stmts.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,13 +1556,14 @@ all other candidate metaclasses. If no such metaclass exists among the candidate
15561556
the class cannot be created, as explained in :ref:`metaclass-determination`.
15571557

15581558
Finally, the memory layouts of the bases must be compatible. This means that it must be
1559-
possible to compute a *solid base* for the class. A class is a solid base if it has a
1560-
nonempty :attr:`~object.__slots__` definition; some other classes may also be solid bases,
1561-
depending on the Python implementation.
1559+
possible to compute a *solid base* for the class. Exactly which classes are solid bases
1560+
depends on the Python implementation.
15621561

15631562
.. impl-detail::
15641563

1565-
In CPython, many but not all classes defined in C are solid bases, including most
1564+
In CPython, a class is a solid base if it has a
1565+
nonempty :attr:`~object.__slots__` definition.
1566+
Many but not all classes defined in C are also solid bases, including most
15661567
builtins (such as :class:`int` or :class:`BaseException`)
15671568
but excluding most concrete :class:`Exception` classes. Generally, a C class
15681569
is a solid base if its underlying struct is different in size from its base class.

Doc/reference/datamodel.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2629,7 +2629,7 @@ Notes on using *__slots__*:
26292629
* :attr:`~object.__class__` assignment works only if both classes have the
26302630
same *__slots__*.
26312631

2632-
* :ref:`Multiple inheritance <tut-multiple>` with multiple slotted parent
2632+
* :ref:`Multiple inheritance <multiple-inheritance>` with multiple slotted parent
26332633
classes can be used,
26342634
but only one parent is allowed to have attributes created by slots
26352635
(the other bases must have empty slot layouts) - violations raise

0 commit comments

Comments
 (0)