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

Method pop

crates/vm/src/builtins/set.rs:345–353  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

343 }
344
345 fn pop(&self, vm: &VirtualMachine) -> PyResult {
346 // TODO: should be pop_front, but that requires rearranging every index
347 if let Some((key, _)) = self.content.pop_back() {
348 Ok(key)
349 } else {
350 let err_msg = vm.ctx.new_str(ascii!("pop from an empty set")).into();
351 Err(vm.new_key_error(err_msg))
352 }
353 }
354
355 fn update(
356 &self,

Callers 11

freelist_popMethod · 0.45
freelist_popMethod · 0.45
freelist_popMethod · 0.45
freelist_popMethod · 0.45
freelist_popMethod · 0.45
format_missing_argsFunction · 0.45
freelist_popMethod · 0.45
pop_thread_frameFunction · 0.45
datastack_popMethod · 0.45
pop_exceptionMethod · 0.45
endFunction · 0.45

Calls 4

pop_backMethod · 0.80
new_key_errorMethod · 0.80
ErrClass · 0.50
new_strMethod · 0.45

Tested by

no test coverage detected