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

Method set_attr

crates/vm/src/builtins/type.rs:887–893  ·  view source on GitHub ↗
(&self, attr_name: &'static PyStrInterned, value: PyObjectRef)

Source from the content-addressed store, hash-verified

885 }
886
887 pub fn set_attr(&self, attr_name: &'static PyStrInterned, value: PyObjectRef) {
888 // Invalidate caches BEFORE modifying attributes so that borrowed
889 // pointers in cache entries are nullified while the source objects
890 // are still alive.
891 self.modified();
892 self.attributes.write().insert(attr_name, value);
893 }
894
895 /// Internal get_attr implementation for fast lookup on a class.
896 /// Searches the full MRO (including self) with method cache acceleration.

Callers 15

convert_openssl_errorFunction · 0.45
set_verify_error_infoFunction · 0.45
extend_classMethod · 0.45
module_execFunction · 0.45
sendMethod · 0.45
throwMethod · 0.45
task_step_handle_resultFunction · 0.45
set_from_windows_errFunction · 0.45
module_execFunction · 0.45
raise_syntax_errorFunction · 0.45
raise_indentation_errorFunction · 0.45
module_execFunction · 0.45

Calls 3

modifiedMethod · 0.45
insertMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected