We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
__slots__
1 parent 4d7f5d0 commit 9c61718Copy full SHA for 9c61718
Doc/reference/datamodel.rst
@@ -1944,8 +1944,10 @@ Notes on using *__slots__*
1944
descriptor directly from the base class). This renders the meaning of the
1945
program undefined. In the future, a check may be added to prevent this.
1946
1947
-* Nonempty *__slots__* does not work for classes derived from "variable-length"
1948
- built-in types such as :class:`int`, :class:`bytes` and :class:`tuple`.
+* :exc:`TypeError` will be raised if nonempty *__slots__* are defined for a
+ class derived from a
1949
+ :c:member:`"variable-length" built-in type <PyTypeObject.tp_itemsize>` such as
1950
+ :class:`int`, :class:`bytes`, and :class:`tuple`.
1951
1952
* Any non-string :term:`iterable` may be assigned to *__slots__*.
1953
0 commit comments