()
| 692 | |
| 693 | #[test] |
| 694 | fn 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 | |
| 704 | py_class!(class SetDelItem |py| { |
| 705 | data val: Cell<Option<i32>>; |