]> granicus.if.org Git - python/commitdiff
Reorder __slots__ fine print and add a clarification.
authorGeorg Brandl <georg@python.org>
Thu, 22 Oct 2009 15:27:24 +0000 (15:27 +0000)
committerGeorg Brandl <georg@python.org>
Thu, 22 Oct 2009 15:27:24 +0000 (15:27 +0000)
Doc/reference/datamodel.rst

index 3f9b181b77a9bc1e536a7d2e7c50451253c9ea78..5189f1f2707d8e0fb6b5e60eed054f144f8a019e 100644 (file)
@@ -1675,15 +1675,15 @@ Notes on using *__slots__*
   *__slots__*; otherwise, the class attribute would overwrite the descriptor
   assignment.
 
+* The action of a *__slots__* declaration is limited to the class where it is
+  defined.  As a result, subclasses will have a *__dict__* unless they also define
+  *__slots__* (which must only contain names of any *additional* slots).
+
 * If a class defines a slot also defined in a base class, the instance variable
   defined by the base class slot is inaccessible (except by retrieving its
   descriptor directly from the base class). This renders the meaning of the
   program undefined.  In the future, a check may be added to prevent this.
 
-* The action of a *__slots__* declaration is limited to the class where it is
-  defined.  As a result, subclasses will have a *__dict__* unless they also define
-  *__slots__*.
-
 * Nonempty *__slots__* does not work for classes derived from "variable-length"
   built-in types such as :class:`long`, :class:`str` and :class:`tuple`.