8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
__slots__
1 parent 125f75c commit 2c015a6Copy full SHA for 2c015a6
Doc/reference/datamodel.rst
@@ -1876,8 +1876,10 @@ Notes on using *__slots__*
1876
descriptor directly from the base class). This renders the meaning of the
1877
program undefined. In the future, a check may be added to prevent this.
1878
1879
-* Nonempty *__slots__* does not work for classes derived from "variable-length"
1880
- 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
1881
+ :c:member:`"variable-length" built-in type <PyTypeObject.tp_itemsize>` such as
1882
+ :class:`int`, :class:`bytes`, and :class:`tuple`.
1883
1884
* Any non-string :term:`iterable` may be assigned to *__slots__*.
1885
0 commit comments