MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / __copy__

Method __copy__

lib/matplotlib/transforms.py:140–152  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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 """

Callers

nothing calls this directly

Calls 3

set_childrenMethod · 0.80
__new__Method · 0.45
updateMethod · 0.45

Tested by

no test coverage detected