Helper for combining of history dicts. If a key occurs twice, both values are added to a compound.
(d1: dict[Shape, Shape], *ds: dict[Shape, Shape])
| 5636 | |
| 5637 | |
| 5638 | def _combine_hist_dict(d1: dict[Shape, Shape], *ds: dict[Shape, Shape]) -> None: |
| 5639 | """ |
| 5640 | Helper for combining of history dicts. |
| 5641 | If a key occurs twice, both values are added to a compound. |
| 5642 | """ |
| 5643 | |
| 5644 | for d in ds: |
| 5645 | common_keys = d1.keys() & d.keys() |
| 5646 | new_keys = d.keys() - d1.keys() |
| 5647 | |
| 5648 | for k in common_keys: |
| 5649 | d1[k] |= d[k] |
| 5650 | |
| 5651 | for k in new_keys: |
| 5652 | d1[k] = d[k] |
| 5653 | |
| 5654 | |
| 5655 | def _combine_ops(op: Op, *ops: Op) -> Op: |
no outgoing calls