This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Use C3 MRO algorithm
Type: Stage:
Components: Interpreter Core Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: gvanrossum Nosy List: gvanrossum
Priority: normal Keywords:

Created on 2002-10-04 19:11 by gvanrossum, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Messages (2)
msg12604 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2002-10-04 19:11
In

http://mail.python.org/pipermail/python-dev/2002-October/029035.html

and following messages, Samuele Pedroni argues that the
current MRO algorithm has some unexpected properties,
and that the "naive" algorithm described in the docs
(keep the last occurrence in a depth-first search) is
not monotonic. The current algorithm is monotonic. A
better algorithm, named C3, is described in this paper:

http://www.webcom.com/haahr/dylan/linearization-oopsla96.html

I believe that the current algorithm is the same as
L*[LOOPS] mentioned in this paper (though I have no
proof). The paper argues convincingly that C3 is better
than L*[LOOPS], so I propose to use C3 starting in
Python 2.3.

This can cause backwards compatibilities in certain
cases, but the new algorithm matches intuition better
than the current algorithm. (The naive algorithm from
the docs is unacceptable due to its non-monotonicity.)
msg12605 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2002-11-14 19:50
Logged In: YES 
user_id=6380

Fixed; I checked in the code from patch 619475.
History
Date User Action Args
2022-04-10 16:05:43adminsetgithub: 37266
2002-10-04 19:11:26gvanrossumcreate