Deep-copy via MASFactory clone semantics instead of Python's generic object walk. This ensures nested NodeTemplate declarations still respect `Shared(...)`, `Factory(...)`, and `__node_template_scope__` when an outer template clones them as part of its prototype config.
(self, memo: dict[int, Any])
| 266 | self.prototype_config = default_kwargs |
| 267 | |
| 268 | def __deepcopy__(self, memo: dict[int, Any]) -> "NodeTemplate[T]": |
| 269 | """Deep-copy via MASFactory clone semantics instead of Python's generic object walk. |
| 270 | |
| 271 | This ensures nested NodeTemplate declarations still respect `Shared(...)`, |
| 272 | `Factory(...)`, and `__node_template_scope__` when an outer template clones |
| 273 | them as part of its prototype config. |
| 274 | """ |
| 275 | obj_id = id(self) |
| 276 | if obj_id in memo: |
| 277 | return memo[obj_id] |
| 278 | |
| 279 | cloned = object.__new__(type(self)) |
| 280 | memo[obj_id] = cloned |
| 281 | cloned.node_cls = self.node_cls |
| 282 | cloned.prototype_config = _safe_clone(self.prototype_config, memo) |
| 283 | return cloned |
| 284 | |
| 285 | def render_config(self, **override_kwargs) -> dict[str, Any]: |
| 286 | final_config = _safe_clone(self.prototype_config) |
nothing calls this directly
no test coverage detected