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

Method writelines

crates/vm/src/stdlib/_io.rs:549–559  ·  view source on GitHub ↗
(
            instance: PyObjectRef,
            lines: ArgIterable,
            vm: &VirtualMachine,
        )

Source from the content-addressed store, hash-verified

547
548 #[pymethod]
549 fn writelines(
550 instance: PyObjectRef,
551 lines: ArgIterable,
552 vm: &VirtualMachine,
553 ) -> PyResult<()> {
554 check_closed(&instance, vm)?;
555 for line in lines.iter(vm)? {
556 vm.call_method(&instance, "write", (line?,))?;
557 }
558 Ok(())
559 }
560
561 #[pymethod(name = "_checkClosed")]
562 fn check_closed(instance: PyObjectRef, vm: &VirtualMachine) -> PyResult<()> {

Callers

nothing calls this directly

Calls 3

check_closedFunction · 0.85
iterMethod · 0.45
call_methodMethod · 0.45

Tested by

no test coverage detected