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

Method file_is_closed

crates/vm/src/vm/vm_object.rs:56–60  ·  view source on GitHub ↗

Returns true if the file object's `closed` attribute is truthy.

(&self, file: &PyObject)

Source from the content-addressed store, hash-verified

54
55 /// Returns true if the file object's `closed` attribute is truthy.
56 fn file_is_closed(&self, file: &PyObject) -> bool {
57 file.get_attr("closed", self)
58 .ok()
59 .is_some_and(|v| v.try_to_bool(self).unwrap_or(false))
60 }
61
62 pub(crate) fn flush_std(&self) -> i32 {
63 let vm = self;

Callers 1

flush_stdMethod · 0.80

Calls 3

okMethod · 0.80
try_to_boolMethod · 0.80
get_attrMethod · 0.45

Tested by

no test coverage detected