@@ -14,7 +14,7 @@ use crate::{
1414 function:: { FuncArgs , OptionalArg , PyComparisonValue } ,
1515 scope:: Scope ,
1616 types:: { Callable , Comparable , Constructor , GetAttr , GetDescriptor , PyComparisonOp } ,
17- AsObject , Context , PyObject , PyObjectRef , PyPayload , PyRef , PyResult , VirtualMachine ,
17+ AsObject , Context , Py , PyObject , PyObjectRef , PyPayload , PyRef , PyResult , VirtualMachine ,
1818} ;
1919#[ cfg( feature = "jit" ) ]
2020use crate :: { common:: lock:: OnceCell , convert:: ToPyObject } ;
@@ -460,12 +460,12 @@ impl Comparable for PyBoundMethod {
460460}
461461
462462impl GetAttr for PyBoundMethod {
463- fn getattro ( zelf : PyRef < Self > , name : PyStrRef , vm : & VirtualMachine ) -> PyResult {
463+ fn getattro ( zelf : & Py < Self > , name : PyStrRef , vm : & VirtualMachine ) -> PyResult {
464464 let class_attr = zelf. get_class_attr ( name. as_str ( ) ) ;
465465 if let Some ( obj) = class_attr {
466- return vm. call_if_get_descriptor ( obj, zelf. into ( ) ) ;
466+ return vm. call_if_get_descriptor ( obj, zelf. to_owned ( ) . into ( ) ) ;
467467 }
468- zelf. function . clone ( ) . get_attr ( name, vm)
468+ zelf. function . get_attr ( name, vm)
469469 }
470470}
471471
@@ -526,7 +526,7 @@ impl PyBoundMethod {
526526
527527 #[ pyproperty( magic) ]
528528 fn doc ( & self , vm : & VirtualMachine ) -> PyResult {
529- self . function . clone ( ) . get_attr ( "__doc__" , vm)
529+ self . function . get_attr ( "__doc__" , vm)
530530 }
531531
532532 #[ pyproperty( magic) ]
@@ -541,7 +541,7 @@ impl PyBoundMethod {
541541
542542 #[ pyproperty( magic) ]
543543 fn module ( & self , vm : & VirtualMachine ) -> Option < PyObjectRef > {
544- self . function . clone ( ) . get_attr ( "__module__" , vm) . ok ( )
544+ self . function . get_attr ( "__module__" , vm) . ok ( )
545545 }
546546
547547 #[ pyproperty( magic) ]
@@ -563,7 +563,7 @@ impl PyBoundMethod {
563563 ) )
564564 . into ( ) ) ;
565565 }
566- self . function . clone ( ) . get_attr ( "__qualname__" , vm)
566+ self . function . get_attr ( "__qualname__" , vm)
567567 }
568568}
569569
0 commit comments