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

Function delitem

tests/test_class.rs:694–702  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

692
693#[test]
694fn delitem() {
695 let gil = Python::acquire_gil();
696 let py = gil.python();
697
698 let c = DelItem::create_instance(py, Cell::new(0)).unwrap();
699 py_run!(py, c, "del c[1]");
700 assert_eq!(c.key(py).get(), 1);
701 py_expect_exception!(py, c, "c[1] = 2", NotImplementedError);
702}
703
704py_class!(class SetDelItem |py| {
705 data val: Cell<Option<i32>>;

Callers

nothing calls this directly

Calls 1

pythonMethod · 0.80

Tested by

no test coverage detected