diff options
Diffstat (limited to 'Doc/reference/datamodel.rst')
-rw-r--r-- | Doc/reference/datamodel.rst | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 3d531c7dca..8f9570005a 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1435,6 +1435,10 @@ saved because *__dict__* is not created for each instance. Notes on using *__slots__* """""""""""""""""""""""""" +* When inheriting from a class without *__slots__*, the *__dict__* attribute of + that class will always be accessible, so a *__slots__* definition in the + subclass is meaningless. + * Without a *__dict__* variable, instances cannot be assigned new variables not listed in the *__slots__* definition. Attempts to assign to an unlisted variable name raises :exc:`AttributeError`. If dynamic assignment of new |