[Pattern] improve clarity of .copy()->.deepcopy()
This commit is contained in:
parent
75dc391540
commit
fa3dfa1e74
1 changed files with 3 additions and 2 deletions
|
|
@ -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:
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue