MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / contains_ref

Function contains_ref

tests/test_class.rs:769–777  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

767
768#[test]
769fn contains_ref() {
770 let gil = Python::acquire_gil();
771 let py = gil.python();
772
773 let c = ContainsRef::create_instance(py).unwrap();
774 py_run!(py, c, "assert '' in c");
775 py_run!(py, c, "assert 'hello' not in c");
776 py_run!(py, c, "assert 42 not in c");
777}
778
779py_class!(class ContainsOptRef |py| {
780 def __contains__(&self, item: Option<&str>) -> PyResult<bool> {

Callers

nothing calls this directly

Calls 1

pythonMethod · 0.80

Tested by

no test coverage detected