summaryrefslogtreecommitdiffstats
path: root/Doc/ref
diff options
context:
space:
mode:
authorŽiga Seilnacht <ziga.seilnacht@gmail.com>2007-03-16 11:59:38 (GMT)
committerŽiga Seilnacht <ziga.seilnacht@gmail.com>2007-03-16 11:59:38 (GMT)
commit6f2d09c949ac0c21c56c97e7f772a2726e34d74f (patch)
treee7244ea4d06e42bc6fd8f1745bed0ce682947c5f /Doc/ref
parent6ab8452036beead2b74d38564162b291f2db643c (diff)
downloadcpython-6f2d09c949ac0c21c56c97e7f772a2726e34d74f.zip
cpython-6f2d09c949ac0c21c56c97e7f772a2726e34d74f.tar.gz
cpython-6f2d09c949ac0c21c56c97e7f772a2726e34d74f.tar.bz2
Patch #1623563: allow __class__ assignment for classes with __slots__.
The old and the new class are still required to have the same slot names, but the order in which they are specified is not relevant.
Diffstat (limited to 'Doc/ref')
-rw-r--r--Doc/ref/ref3.tex8
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/ref/ref3.tex b/Doc/ref/ref3.tex
index c5dbfd2..c0f3219 100644
--- a/Doc/ref/ref3.tex
+++ b/Doc/ref/ref3.tex
@@ -1593,6 +1593,11 @@ built-in types such as \class{long}, \class{str} and \class{tuple}.
Mappings may also be used; however, in the future, special meaning may
be assigned to the values corresponding to each key.
+\item \var{__class__} assignment works only if both classes have the
+same \var{__slots__}.
+\versionchanged[Previously, \var{__class__} assignment raised an error
+if either new or old class had \var{__slots__}]{2.6}
+
\end{itemize}
@@ -2223,3 +2228,6 @@ exception; this is the caller's responsibility.
Python \keyword{with} statement.}
\end{seealso}
+
+
+