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

Method mode

crates/vm/src/stdlib/_io.rs:5706–5729  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

5704
5705 #[pygetset]
5706 fn mode(&self) -> &'static str {
5707 let mode = self.mode.load();
5708 if mode.contains(Mode::CREATED) {
5709 if mode.contains(Mode::READABLE) {
5710 "xb+"
5711 } else {
5712 "xb"
5713 }
5714 } else if mode.contains(Mode::APPENDING) {
5715 if mode.contains(Mode::READABLE) {
5716 "ab+"
5717 } else {
5718 "ab"
5719 }
5720 } else if mode.contains(Mode::READABLE) {
5721 if mode.contains(Mode::WRITABLE) {
5722 "rb+"
5723 } else {
5724 "rb"
5725 }
5726 } else {
5727 "wb"
5728 }
5729 }
5730
5731 #[pymethod]
5732 fn read(

Callers 9

_getfinalpathnameFunction · 0.45
_getfullpathnameFunction · 0.45
_getvolumepathnameFunction · 0.45
readlinkFunction · 0.45
repr_strMethod · 0.45
accessFunction · 0.45
listdirFunction · 0.45
readlinkFunction · 0.45
scandirFunction · 0.45

Calls 2

loadMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected