MCPcopy Index your code
hub / github.com/RustPython/RustPython / class

Method class

crates/vm/src/vm/mod.rs:1764–1773  ·  view source on GitHub ↗
(&self, module: &'static str, class: &'static str)

Source from the content-addressed store, hash-verified

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`.

Callers 15

new_js_errorFunction · 0.45
py_err_to_js_errFunction · 0.45
do_handshakeMethod · 0.45
delMethod · 0.45
repr_strMethod · 0.45
repr_wtf8Method · 0.45
is_coroutineFunction · 0.45
readMethod · 0.45
__reduce_ex__Method · 0.45
__reduce__Method · 0.45
repr_strMethod · 0.45
new_lzma_errorFunction · 0.45

Calls 3

downcastMethod · 0.80
importMethod · 0.45
get_attrMethod · 0.45

Tested by

no test coverage detected