Skip to content

Commit e5bf112

Browse files
committed
Implement __func__ in @staticmethod
1 parent 119913b commit e5bf112

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

vm/src/builtins/staticmethod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ impl PyStaticMethod {
6868

6969
#[pyimpl(with(Callable, GetDescriptor, Constructor), flags(BASETYPE, HAS_DICT))]
7070
impl PyStaticMethod {
71+
#[pyproperty(magic)]
72+
fn func(&self) -> PyObjectRef {
73+
self.callable.clone()
74+
}
75+
7176
#[pyproperty(magic)]
7277
fn isabstractmethod(&self, vm: &VirtualMachine) -> PyObjectRef {
7378
match vm.get_attribute_opt(self.callable.clone(), "__isabstractmethod__") {

0 commit comments

Comments
 (0)