Commit 0b2b6b7
Add __iter__ to RDom bindings (#8861)
* Add __iter__ to RDom Python bindings
Previously, iterating over an RDom with list() or a for loop would fail
with a KeyError. While __len__ and __getitem__ were defined, the Python
iterator protocol requires __iter__ to return an iterator object.
This adds a lightweight RDomIterator helper and exposes it via __iter__,
allowing natural iteration:
r = hl.RDom([(0, 10), (0, 20)])
for v in r: ...
list(r) # returns [RVar, RVar]
Adds test coverage in the existing rdom.py correctness test.
* Fix Python test label propagation in AddPythonTest.cmake
The LABEL argument was not being propagated to set_tests_properties,
causing -L filters to not work correctly. Now both 'python' and the
specific label (e.g., 'python_correctness') are applied to each test.
Co-Authored-By: GitHub Copilot <github-copilot@users.noreply.github.com>1 parent 1c38f3f commit 0b2b6b7
3 files changed
Lines changed: 44 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | | - | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
33 | 60 | | |
34 | 61 | | |
35 | 62 | | |
| |||
41 | 68 | | |
42 | 69 | | |
43 | 70 | | |
| 71 | + | |
44 | 72 | | |
45 | 73 | | |
46 | 74 | | |
47 | 75 | | |
48 | 76 | | |
49 | | - | |
| 77 | + | |
50 | 78 | | |
51 | 79 | | |
52 | 80 | | |
| |||
55 | 83 | | |
56 | 84 | | |
57 | 85 | | |
58 | | - | |
| 86 | + | |
59 | 87 | | |
60 | 88 | | |
61 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
49 | 59 | | |
50 | 60 | | |
51 | 61 | | |
| |||
67 | 77 | | |
68 | 78 | | |
69 | 79 | | |
| 80 | + | |
0 commit comments