various fixes
This commit is contained in:
parent
b98553a770
commit
d14182998b
6 changed files with 31 additions and 24 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue