()
| 767 | |
| 768 | #[test] |
| 769 | fn contains_ref() { |
| 770 | let gil = Python::acquire_gil(); |
| 771 | let py = gil.python(); |
| 772 | |
| 773 | let c = ContainsRef::create_instance(py).unwrap(); |
| 774 | py_run!(py, c, "assert '' in c"); |
| 775 | py_run!(py, c, "assert 'hello' not in c"); |
| 776 | py_run!(py, c, "assert 42 not in c"); |
| 777 | } |
| 778 | |
| 779 | py_class!(class ContainsOptRef |py| { |
| 780 | def __contains__(&self, item: Option<&str>) -> PyResult<bool> { |