()
| 597 | |
| 598 | #[test] |
| 599 | fn 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 | |
| 611 | py_class!(class SetItem |py| { |
| 612 | data key: Cell<i32>; |