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

Method try_class

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

Source from the content-addressed store, hash-verified

1753 }
1754
1755 pub fn try_class(&self, module: &'static str, class: &'static str) -> PyResult<PyTypeRef> {
1756 let class = self
1757 .import(module, 0)?
1758 .get_attr(class, self)?
1759 .downcast()
1760 .expect("not a class");
1761 Ok(class)
1762 }
1763
1764 pub fn class(&self, module: &'static str, class: &'static str) -> PyTypeRef {
1765 let module = self

Callers 4

py_err_to_js_errFunction · 0.80
py_to_jsFunction · 0.80
js_to_pyFunction · 0.80
py_decode_errorFunction · 0.80

Calls 3

downcastMethod · 0.80
get_attrMethod · 0.45
importMethod · 0.45

Tested by

no test coverage detected