[Pattern] improve clarity of .copy()->.deepcopy()

This commit is contained in:
jan 2026-03-10 00:31:11 -07:00
commit fa3dfa1e74

View file

@ -172,7 +172,8 @@ class Pattern(PortList, AnnotatableImpl, Mirrorable):
return s
def __copy__(self) -> 'Pattern':
logger.warning('Making a shallow copy of a Pattern... old shapes are re-referenced!')
logger.warning('Making a shallow copy of a Pattern... old shapes/refs/labels are re-referenced! '
'Consider using .deepcopy() if this was not intended.')
new = Pattern(
annotations=copy.deepcopy(self.annotations),
ports=copy.deepcopy(self.ports),
@ -860,7 +861,7 @@ class Pattern(PortList, AnnotatableImpl, Mirrorable):
Returns:
A deep copy of the current Pattern.
"""
return copy.deepcopy(self)
return self.deepcopy()
def deepcopy(self) -> Self:
"""