Use __slots__ for class members

Also use the other sort of type hints for instance variables
This commit is contained in:
Jan Petykiewicz 2019-05-17 00:37:56 -07:00
commit 38f64f7c62
11 changed files with 89 additions and 72 deletions

View file

@ -21,13 +21,13 @@ class SubPattern:
SubPattern provides basic support for nesting Pattern objects within each other, by adding
offset, rotation, scaling, and associated methods.
"""
pattern = None # type: Pattern
_offset = (0.0, 0.0) # type: numpy.ndarray
_rotation = 0.0 # type: float
_dose = 1.0 # type: float
_scale = 1.0 # type: float
_mirrored = None # type: List[bool]
__slots__ = ('pattern', '_offset', '_rotation', '_dose', '_scale', '_mirrored', 'identifier')
pattern: 'Pattern'
_offset: numpy.ndarray
_rotation: float
_dose: float
_scale: float
_mirrored: List[bool]
identifier: Tuple
def __init__(self,