MCPcopy
hub / github.com/CadQuery/cadquery / _combine_hist_dict

Function _combine_hist_dict

cadquery/occ_impl/shapes.py:5638–5652  ·  view source on GitHub ↗

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])

Source from the content-addressed store, hash-verified

5636
5637
5638def _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
5655def _combine_ops(op: Op, *ops: Op) -> Op:

Callers 2

test_comibine_hist_dictFunction · 0.90
_combine_opsFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_comibine_hist_dictFunction · 0.72