()
| 29 | |
| 30 | |
| 31 | def test_eval_pyobjects_cycle(): |
| 32 | class MyClass: |
| 33 | def __init__(self): |
| 34 | self.a = 1 |
| 35 | self.b = 2 |
| 36 | self.recursive = self |
| 37 | |
| 38 | o = MyClass() |
| 39 | |
| 40 | assert pm.eval("(obj) => { return obj.a; }")(o) == 1.0 |
| 41 | assert pm.eval("(obj) => { return obj.b; }")(o) == 2.0 |
| 42 | assert pm.eval("(obj) => { return obj.recursive; }")(o) is o.recursive |
| 43 | |
| 44 | |
| 45 | def test_eval_pyobjects_proxy_get(): |