Add classmethod.__func__

This commit is contained in:
Jeong YunWon committed 2019-05-11 05:30:27 +09:00
1 parent b720681c7b
commit 7564833b6e
2 files changed
+8

No files matched your search

+3
View File
@@ -152,3 +152,6 @@ class T4:
assert T4.__doc__ == "test4"
assert T4.t1.__doc__ == "t1"
cm = classmethod(lambda cls: cls)
assert cm.__func__(int) is int
+5
View File
@@ -57,6 +57,11 @@ impl PyClassMethod {
.ctx
.new_bound_method(self.callable.clone(), owner.clone()))
}
#[pyproperty(name = "__func__")]
fn func(&self, _vm: &VirtualMachine) -> PyObjectRef {
self.callable.clone()
}
}
pub fn init(context: &PyContext) {