Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6af5239

Browse files
committed
Add placeholder section on old and new-style classes
1 parent e63fde7 commit 6af5239

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Doc/ref/ref3.tex

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,20 @@ \section{The standard type hierarchy\label{types}}
10311031

10321032
\end{description} % Types
10331033

1034+
%=========================================================================
1035+
\section{New-style and classic classes}
10341036

1037+
Classes and instances come in two flavours: old-style or classic, and new-style.
1038+
1039+
Old-style classes were the only flavour of class available before Python 2.1. While they supported multiple inheritance, the rules for resolving names were chosen for ease of implementation. These rules turn out to make multiple inheritance hard to use in certain situations.
1040+
1041+
New-style classes were introduced in Python 2.1, and change the method resolution order to make multiple inheritance more usable.
1042+
1043+
The plan is to eventually drop old-style classes, leaving only the semantics of new-style classes. This change will probably only be feasible in Python 3.0.
1044+
1045+
1046+
1047+
%=========================================================================
10351048
\section{Special method names\label{specialnames}}
10361049

10371050
A class can implement certain operations that are invoked by special

0 commit comments

Comments
 (0)