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

Method __module_set_attr

crates/vm/src/vm/mod.rs:2184–2194  ·  view source on GitHub ↗
(
        &self,
        module: &Py<PyModule>,
        attr_name: &'static PyStrInterned,
        attr_value: impl Into<PyObjectRef>,
    )

Source from the content-addressed store, hash-verified

2182
2183 #[doc(hidden)]
2184 pub fn __module_set_attr(
2185 &self,
2186 module: &Py<PyModule>,
2187 attr_name: &'static PyStrInterned,
2188 attr_value: impl Into<PyObjectRef>,
2189 ) -> PyResult<()> {
2190 let val = attr_value.into();
2191 module
2192 .as_object()
2193 .generic_setattr(attr_name, PySetterValue::Assign(val), self)
2194 }
2195
2196 pub fn insert_sys_path(&self, obj: PyObjectRef) -> PyResult<()> {
2197 let sys_path = self.sys_module.get_attr("path", self).unwrap();

Callers 1

__init_methodsMethod · 0.80

Calls 2

generic_setattrMethod · 0.80
as_objectMethod · 0.45

Tested by

no test coverage detected