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

Method is_none

crates/vm/src/vm/vm_object.rs:100–102  ·  view source on GitHub ↗

Test whether a python object is `None`.

(&self, obj: &PyObject)

Source from the content-addressed store, hash-verified

98
99 /// Test whether a python object is `None`.
100 pub fn is_none(&self, obj: &PyObject) -> bool {
101 obj.is(&self.ctx.none)
102 }
103 pub fn option_if_none(&self, obj: PyObjectRef) -> Option<PyObjectRef> {
104 if self.is_none(&obj) { None } else { Some(obj) }
105 }

Callers 15

test_is_noneMethod · 0.45
runFunction · 0.45
thenMethod · 0.45
hexlifyFunction · 0.45
_servername_callbackFunction · 0.45
set_sni_callbackMethod · 0.45
set_msg_callbackMethod · 0.45
_wrap_socketMethod · 0.45
_wrap_bioMethod · 0.45
syslogFunction · 0.45

Calls 1

isMethod · 0.80

Tested by 1

test_is_noneMethod · 0.36