File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -298,9 +298,22 @@ impl PyBoundMethod {
298
298
) )
299
299
}
300
300
301
+ #[ pyproperty( magic) ]
302
+ fn doc ( & self , vm : & VirtualMachine ) -> PyResult {
303
+ vm. get_attribute ( self . function . clone ( ) , "__doc__" )
304
+ }
305
+
301
306
#[ pymethod( magic) ]
302
- fn getattribute ( & self , name : PyStringRef , vm : & VirtualMachine ) -> PyResult {
303
- vm. get_attribute ( self . function . clone ( ) , name)
307
+ fn getattribute ( zelf : PyRef < Self > , name : PyStringRef , vm : & VirtualMachine ) -> PyResult {
308
+ if let Some ( obj) = zelf. class ( ) . get_attr ( name. as_str ( ) ) {
309
+ return vm. call_if_get_descriptor ( obj, zelf. into_object ( ) ) ;
310
+ }
311
+ vm. get_attribute ( zelf. function . clone ( ) , name)
312
+ }
313
+
314
+ #[ pyproperty( magic) ]
315
+ fn func ( & self ) -> PyObjectRef {
316
+ self . function . clone ( )
304
317
}
305
318
}
306
319
You can’t perform that action at this time.
0 commit comments