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

Method slot_del

crates/vm/src/stdlib/_io.rs:583–591  ·  view source on GitHub ↗
(zelf: &PyObject, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

581
582 impl Destructor for _IOBase {
583 fn slot_del(zelf: &PyObject, vm: &VirtualMachine) -> PyResult<()> {
584 // C-level IO types (FileIO, Buffered*, TextIOWrapper) have their own
585 // slot_del that calls iobase_finalize with proper _finalizing flag
586 // and _dealloc_warn chain. This base fallback is only reached by
587 // Python-level subclasses, where we silently discard close() errors
588 // to avoid surfacing unraisable from partially initialized objects.
589 let _ = vm.call_method(zelf, "close", ());
590 Ok(())
591 }
592
593 #[cold]
594 fn del(_zelf: &Py<Self>, _vm: &VirtualMachine) -> PyResult<()> {

Callers

nothing calls this directly

Calls 3

iobase_finalizeFunction · 0.85
call_methodMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected