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

Method get_attributes

crates/vm/src/builtins/type.rs:1134–1146  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

1132 }
1133
1134 pub fn get_attributes(&self) -> PyAttributes {
1135 // Gather all members here:
1136 let mut attributes = PyAttributes::default();
1137
1138 // mro[0] is self, so we iterate through the entire MRO in reverse
1139 for bc in self.mro.read().iter().map(|cls| -> &Self { cls }).rev() {
1140 for (name, value) in bc.attributes.read().iter() {
1141 attributes.insert(name.to_owned(), value.clone());
1142 }
1143 }
1144
1145 attributes
1146 }
1147
1148 // bound method for every type
1149 pub(crate) fn __new__(zelf: PyRef<Self>, args: FuncArgs, vm: &VirtualMachine) -> PyResult {

Callers 2

dirMethod · 0.80
__dir__Method · 0.80

Calls 7

revMethod · 0.45
mapMethod · 0.45
iterMethod · 0.45
readMethod · 0.45
insertMethod · 0.45
to_ownedMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected