Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use C3 MRO algorithm #37266

Closed
gvanrossum opened this issue Oct 4, 2002 · 2 comments
Closed

Use C3 MRO algorithm #37266

gvanrossum opened this issue Oct 4, 2002 · 2 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@gvanrossum
Copy link
Member

BPO 618704
Nosy @gvanrossum

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/gvanrossum'
closed_at = <Date 2002-11-14.19:50:56.000>
created_at = <Date 2002-10-04.19:11:26.000>
labels = ['interpreter-core']
title = 'Use C3 MRO algorithm'
updated_at = <Date 2002-11-14.19:50:56.000>
user = 'https://github.com/gvanrossum'

bugs.python.org fields:

activity = <Date 2002-11-14.19:50:56.000>
actor = 'gvanrossum'
assignee = 'gvanrossum'
closed = True
closed_date = None
closer = None
components = ['Interpreter Core']
creation = <Date 2002-10-04.19:11:26.000>
creator = 'gvanrossum'
dependencies = []
files = []
hgrepos = []
issue_num = 618704
keywords = []
message_count = 2.0
messages = ['12604', '12605']
nosy_count = 1.0
nosy_names = ['gvanrossum']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue618704'
versions = ['Python 2.3']

@gvanrossum
Copy link
Member Author

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.)

@gvanrossum gvanrossum self-assigned this Oct 4, 2002
@gvanrossum gvanrossum added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Oct 4, 2002
@gvanrossum
Copy link
Member Author

Logged In: YES
user_id=6380

Fixed; I checked in the code from patch 619475.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)
Projects
None yet
Development

No branches or pull requests

1 participant