Skip to content

Instantly share code, notes, and snippets.

@mrbazzan
mrbazzan / mro.py
Last active August 8, 2025 21:37
Python's Method Resolution Order
# C3 ALGORITHM
# Original paper by Michele Simionato: https://www.python.org/download/releases/2.3/mro/
# Python3 Implementation.
def merge(seqs):
res = [];
while True:
nonemptyseqs=[seq for seq in seqs if seq]
if not nonemptyseqs: return res