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

Method __enter__

crates/vm/src/stdlib/_io.rs:452–455  ·  view source on GitHub ↗
(instance: PyObjectRef, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

450
451 #[pymethod]
452 fn __enter__(instance: PyObjectRef, vm: &VirtualMachine) -> PyResult {
453 check_closed(&instance, vm)?;
454 Ok(instance)
455 }
456
457 #[pymethod]
458 fn __exit__(instance: PyObjectRef, _args: FuncArgs, vm: &VirtualMachine) -> PyResult<()> {

Callers

nothing calls this directly

Calls 1

check_closedFunction · 0.85

Tested by

no test coverage detected