Only swap between tuple/list if actually necessary

This commit is contained in:
Jan Petykiewicz 2020-05-23 19:39:48 -07:00
parent 07ee25e735
commit 53d2a9ca1a

View File

@ -764,6 +764,7 @@ class Pattern:
Returns:
self
"""
if not self.locked:
self.shapes = tuple(self.shapes)
self.labels = tuple(self.labels)
self.subpatterns = tuple(self.subpatterns)
@ -777,6 +778,7 @@ class Pattern:
Returns:
self
"""
if self.locked:
object.__setattr__(self, 'locked', False)
self.shapes = list(self.shapes)
self.labels = list(self.labels)