()
| 578 | |
| 579 | #[test] |
| 580 | fn 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 | |
| 592 | py_class!(class Callable |py| { |
| 593 | def __call__(&self, arg: i32) -> PyResult<i32> { |