MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / exec_del_attr

Method exec_del_attr

compiler/src/modules/vm/builtins/attr.rs:116–120  ·  view source on GitHub ↗

`del obj.attr` opcode: pop the object, remove the named attribute in place. */

(&mut self, op: u16, chunk: &crate::modules::parser::SSAChunk)

Source from the content-addressed store, hash-verified

114
115 /* `del obj.attr` opcode: pop the object, remove the named attribute in place. */
116 pub fn exec_del_attr(&mut self, op: u16, chunk: &crate::modules::parser::SSAChunk) -> Result<(), VmErr> {
117 let obj = self.pop()?;
118 let name = chunk.names.get(op as usize).ok_or(cold_runtime("DelAttr: bad name index"))?.clone();
119 self.delete_attr_named(obj, &name)
120 }
121
122 /* Shared attribute removal for `delattr()` and `del obj.attr`; AttributeError when absent. */
123 fn delete_attr_named(&mut self, obj: Val, name: &str) -> Result<(), VmErr> {

Callers 1

dispatch_genericMethod · 0.80

Calls 4

cold_runtimeFunction · 0.85
delete_attr_namedMethod · 0.80
popMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected