()
| 361 | |
| 362 | #[test] |
| 363 | fn static_data() { |
| 364 | let gil = Python::acquire_gil(); |
| 365 | let py = gil.python(); |
| 366 | |
| 367 | let d = PyDict::new(py); |
| 368 | d.set_item(py, "C", py.get_type::<StaticData>()).unwrap(); |
| 369 | py.run("assert C.VAL1 == 123", None, Some(&d)).unwrap(); |
| 370 | py.run("assert C.VAL2 is None", None, Some(&d)).unwrap(); |
| 371 | assert!(py.run("C.VAL1 = 124", None, Some(&d)).is_err()); |
| 372 | } |
| 373 | |
| 374 | py_class!(class GCIntegration |py| { |
| 375 | data self_ref: RefCell<PyObject>; |