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

Function sequence_ref

tests/test_class.rs:580–590  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

578
579#[test]
580fn sequence_ref() {
581 let gil = Python::acquire_gil();
582 let py = gil.python();
583
584 let c = SequenceRef::create_instance(py).unwrap();
585 py_assert!(py, c, "c['abc'] == 'Item for abc'");
586 py_run!(py, c, "del c['abc']");
587 py_expect_exception!(py, c, "c['']", IndexError);
588 py_expect_exception!(py, c, "c[42]", TypeError);
589 py_expect_exception!(py, c, "del c['']", IndexError);
590}
591
592py_class!(class Callable |py| {
593 def __call__(&self, arg: i32) -> PyResult<i32> {

Callers

nothing calls this directly

Calls 1

pythonMethod · 0.80

Tested by

no test coverage detected