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

Method check_init

crates/vm/src/stdlib/_io.rs:833–844  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

831
832 impl BufferedData {
833 fn check_init(&self, vm: &VirtualMachine) -> PyResult<&PyObject> {
834 if let Some(raw) = &self.raw {
835 Ok(raw)
836 } else {
837 let msg = if self.flags.contains(BufferedFlags::DETACHED) {
838 "raw stream has been detached"
839 } else {
840 "I/O operation on uninitialized object"
841 };
842 Err(vm.new_value_error(msg))
843 }
844 }
845
846 #[inline]
847 const fn writable(&self) -> bool {

Callers 15

raw_seekMethod · 0.80
raw_tellMethod · 0.80
seekMethod · 0.80
truncateMethod · 0.80
seekableMethod · 0.80
get_raw_unlockedMethod · 0.80
filenoMethod · 0.80
isattyMethod · 0.80
close_strictMethod · 0.80
closeMethod · 0.80
readMethod · 0.80
peekMethod · 0.80

Calls 2

ErrClass · 0.50
containsMethod · 0.45

Tested by

no test coverage detected