various fixes

This commit is contained in:
Jan Petykiewicz 2020-08-12 21:43:46 -07:00
commit d14182998b
6 changed files with 31 additions and 24 deletions

View file

@ -31,16 +31,17 @@ class Shape(PositionableImpl, LayerableImpl, DoseableImpl, Rotatable, Mirrorable
"""
Abstract class specifying functions common to all shapes.
"""
__slots__ = () # Children should use AutoSlots
identifier: Tuple
""" An arbitrary identifier for the shape, usually empty but used by `Pattern.flatten()` """
# def __copy__(self) -> 'Shape':
# cls = self.__class__
# new = cls.__new__(cls)
# for name in Shape.__slots__ + self.__slots__:
# object.__setattr__(new, name, getattr(self, name))
# return new
def __copy__(self) -> 'Shape':
cls = self.__class__
new = cls.__new__(cls)
for name in self.__slots__:
object.__setattr__(new, name, getattr(self, name))
return new
'''
--- Abstract methods