Get an attribute by name. `attr_name` can be a `&str`, `String`, or `PyStrRef`.
(&self, attr_name: impl AsPyStr<'a>, vm: &VirtualMachine)
| 127 | /// Get an attribute by name. |
| 128 | /// `attr_name` can be a `&str`, `String`, or `PyStrRef`. |
| 129 | pub fn get_attr<'a>(&self, attr_name: impl AsPyStr<'a>, vm: &VirtualMachine) -> PyResult { |
| 130 | let attr_name = attr_name.as_pystr(&vm.ctx); |
| 131 | self.get_attr_inner(attr_name, vm) |
| 132 | } |
| 133 | |
| 134 | // get_attribute should be used for full attribute access (usually from user code). |
| 135 | #[cfg_attr(feature = "flame-it", flame("PyObjectRef"))] |
no test coverage detected