()
| 445 | |
| 446 | #[test] |
| 447 | fn iterator() { |
| 448 | let gil = Python::acquire_gil(); |
| 449 | let py = gil.python(); |
| 450 | |
| 451 | let inst = Iterator::create_instance(py, RefCell::new(Box::new(5..8))).unwrap(); |
| 452 | py_assert!(py, inst, "iter(inst) is inst"); |
| 453 | py_assert!(py, inst, "list(inst) == [5, 6, 7]"); |
| 454 | } |
| 455 | |
| 456 | py_class!(class StringMethods |py| { |
| 457 | def __str__(&self) -> PyResult<&'static str> { |