Correct object.__repr__ format

This commit is contained in:
Moreal
2021-09-01 23:41:18 +09:00
parent 8473ea9911
commit 894fa5b0e9

View File

@@ -185,7 +185,11 @@ impl PyBaseObject {
/// Return repr(self).
#[pymethod(magic)]
fn repr(zelf: PyObjectRef) -> String {
format!("<{} object at {:#x}>", zelf.class().name, zelf.get_id())
format!(
"<{} object at {:#x}>",
zelf.class().tp_name(),
zelf.get_id()
)
}
#[pyclassmethod(magic)]