(&self, vm: &VirtualMachine)
| 135 | |
| 136 | impl Py<PyModule> { |
| 137 | pub fn __init_methods(&self, vm: &VirtualMachine) -> PyResult<()> { |
| 138 | debug_assert!(self.def.is_some()); |
| 139 | for method in self.def.unwrap().methods { |
| 140 | let func = method |
| 141 | .to_function() |
| 142 | .with_module(self.name.unwrap()) |
| 143 | .into_ref(&vm.ctx); |
| 144 | vm.__module_set_attr(self, vm.ctx.intern_str(method.name), func)?; |
| 145 | } |
| 146 | Ok(()) |
| 147 | } |
| 148 | |
| 149 | fn getattr_inner(&self, name: &Py<PyStr>, vm: &VirtualMachine) -> PyResult { |
| 150 | if let Some(attr) = self.as_object().generic_getattr_opt(name, None, vm)? { |
no test coverage detected