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

Method f_lineno

crates/vm/src/builtins/frame.rs:475–483  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

473
474 #[pygetset]
475 pub fn f_lineno(&self) -> usize {
476 // If lasti is 0, execution hasn't started yet - use first line number
477 // Similar to PyCode_Addr2Line which returns co_firstlineno for addr_q < 0
478 if self.lasti() == 0 {
479 self.code.first_line_number.map(|n| n.get()).unwrap_or(1)
480 } else {
481 self.current_location().line.get()
482 }
483 }
484
485 #[pygetset(setter)]
486 fn set_f_lineno(&self, value: PySetterValue, vm: &VirtualMachine) -> PyResult<()> {

Callers 1

setup_contextFunction · 0.80

Calls 4

lastiMethod · 0.80
current_locationMethod · 0.80
mapMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected