C3 linearization
From Wikipedia, the free encyclopedia
The C3 superclass linearization is an algorithm used primarily to obtain a consistent linearization of a multiple inheritance hierarchy in object-oriented programming. This linearization is used to resolve the order in which methods should be inherited, and is often termed "MRO" for Method Resolution Order. The name C3 refers to the three important properties of the resulting linearization: a consistent extended precedence graph, preservation of local precedence order, and monotonicity. It was first published at the 1996 OOPSLA conference, in a paper entitled "A Monotonic Superclass Linearization for Dylan"[1]. Subsequently, it has been chosen as the default algorithm for method resolution in Python 2.3, Perl 6, and Parrot. An extension implementation for Perl 5 named Class::C3 exists on CPAN.
[edit] References
- ^ (1996-06-28) "A Monotonic Superclass Linearization for Dylan". OOPSLA '96 Conference Proceedings: 69–82, ACM Press. DOI:10.1145/236337.236343. ISBN 0-89791-788-X.