(&self, module: &'static str, class: &'static str)
| 1762 | } |
| 1763 | |
| 1764 | pub fn class(&self, module: &'static str, class: &'static str) -> PyTypeRef { |
| 1765 | let module = self |
| 1766 | .import(module, 0) |
| 1767 | .unwrap_or_else(|_| panic!("unable to import {module}")); |
| 1768 | |
| 1769 | let class = module |
| 1770 | .get_attr(class, self) |
| 1771 | .unwrap_or_else(|_| panic!("module {module:?} has no class {class}")); |
| 1772 | class.downcast().expect("not a class") |
| 1773 | } |
| 1774 | |
| 1775 | /// Call Python __import__ function without from_list. |
| 1776 | /// Roughly equivalent to `import module_name` or `import top.submodule`. |
no test coverage detected