Only swap between tuple/list if actually necessary
This commit is contained in:
parent
07ee25e735
commit
53d2a9ca1a
@ -764,6 +764,7 @@ class Pattern:
|
|||||||
Returns:
|
Returns:
|
||||||
self
|
self
|
||||||
"""
|
"""
|
||||||
|
if not self.locked:
|
||||||
self.shapes = tuple(self.shapes)
|
self.shapes = tuple(self.shapes)
|
||||||
self.labels = tuple(self.labels)
|
self.labels = tuple(self.labels)
|
||||||
self.subpatterns = tuple(self.subpatterns)
|
self.subpatterns = tuple(self.subpatterns)
|
||||||
@ -777,6 +778,7 @@ class Pattern:
|
|||||||
Returns:
|
Returns:
|
||||||
self
|
self
|
||||||
"""
|
"""
|
||||||
|
if self.locked:
|
||||||
object.__setattr__(self, 'locked', False)
|
object.__setattr__(self, 'locked', False)
|
||||||
self.shapes = list(self.shapes)
|
self.shapes = list(self.shapes)
|
||||||
self.labels = list(self.labels)
|
self.labels = list(self.labels)
|
||||||
|
Loading…
Reference in New Issue
Block a user