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

Function callable

tests/test_class.rs:599–609  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

597
598#[test]
599fn callable() {
600 let gil = Python::acquire_gil();
601 let py = gil.python();
602
603 let c = Callable::create_instance(py).unwrap();
604 py_assert!(py, c, "callable(c)");
605 py_assert!(py, c, "c(7) == 42");
606
607 let nc = Comparisons::create_instance(py, 0).unwrap();
608 py_assert!(py, nc, "not callable(nc)");
609}
610
611py_class!(class SetItem |py| {
612 data key: Cell<i32>;

Callers

nothing calls this directly

Calls 1

pythonMethod · 0.80

Tested by

no test coverage detected