mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-17 01:51:39 +09:00
To my surprise the C3 algorithm was implemented, however I have found a few problems which cause it to appear like it isn't: - Bad mro usage in super: starting from the current class mro instead of the original class at the index of the current class. This leads to skipping classes gotten from multiple inheritance. - A minor error in mro c3 implementation - not keeping local precedence ordering. - The mro c3 implementation also allowed duplicate base classes. (Not from the issue but I noticed this anyway). To allow the fix in new class creation I added an optional vm argument. This allows the class creation to correctly throw type errors at mro errors. Due to classes being necessary to vm creation in the first place, this argument is optional (and should only be skipped during initial type creation) and if there is an error here, it will panic instead of returning it.