File tree 1 file changed +8
-2
lines changed 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -80,10 +80,15 @@ impl PyObject {
80
80
self . get_attr ( attr_name, vm) . map ( |o| vm. is_none ( & o) )
81
81
}
82
82
83
- // get_attribute should be used for full attribute access (usually from user code).
84
- #[ cfg_attr( feature = "flame-it" , flame( "PyObjectRef" ) ) ]
85
83
pub fn get_attr ( & self , attr_name : impl IntoPyStrRef , vm : & VirtualMachine ) -> PyResult {
86
84
let attr_name = attr_name. into_pystr_ref ( vm) ;
85
+ self . _get_attr ( attr_name, vm)
86
+ }
87
+
88
+ // get_attribute should be used for full attribute access (usually from user code).
89
+ #[ cfg_attr( feature = "flame-it" , flame( "PyObjectRef" ) ) ]
90
+ #[ inline]
91
+ fn _get_attr ( & self , attr_name : PyStrRef , vm : & VirtualMachine ) -> PyResult {
87
92
vm_trace ! ( "object.__getattribute__: {:?} {:?}" , obj, attr_name) ;
88
93
let getattro = self
89
94
. class ( )
@@ -290,6 +295,7 @@ impl PyObject {
290
295
_ => Err ( vm. new_unsupported_binop_error ( self , other, op. operator_token ( ) ) ) ,
291
296
}
292
297
}
298
+ #[ inline( always) ]
293
299
pub fn rich_compare_bool (
294
300
& self ,
295
301
other : & Self ,
You can’t perform that action at this time.
0 commit comments