mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
Fixed to return the mro function
Fixed to return the mro function to include its own class Fixes #1490
This commit is contained in:
@@ -220,8 +220,9 @@ impl PyClassRef {
|
||||
}
|
||||
|
||||
fn type_mro(cls: PyClassRef, vm: &VirtualMachine) -> PyObjectRef {
|
||||
vm.ctx
|
||||
.new_list(cls.mro.iter().map(|x| x.clone().into_object()).collect())
|
||||
let mut mro = vec![cls.clone().into_object()];
|
||||
mro.extend(cls.mro.iter().map(|x| x.clone().into_object()));
|
||||
vm.ctx.new_list(mro)
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user