(self)
| 138 | for k, v in self._parents.items() if v is not None} |
| 139 | |
| 140 | def __copy__(self): |
| 141 | cls = type(self) |
| 142 | other = cls.__new__(cls) |
| 143 | other.__dict__.update(self.__dict__) |
| 144 | # If `c = a + b; a1 = copy(a)`, then modifications to `a1` do not |
| 145 | # propagate back to `c`, i.e. we need to clear the parents of `a1`. |
| 146 | other._parents = {} |
| 147 | # If `c = a + b; c1 = copy(c)`, then modifications to `a` also need to |
| 148 | # be propagated to `c1`. |
| 149 | for key, val in vars(self).items(): |
| 150 | if isinstance(val, TransformNode) and id(self) in val._parents: |
| 151 | other.set_children(val) # val == getattr(other, key) |
| 152 | return other |
| 153 | |
| 154 | def invalidate(self): |
| 155 | """ |
nothing calls this directly
no test coverage detected