Use __slots__ for class members
Also use the other sort of type hints for instance variables
This commit is contained in:
parent
0b962999b2
commit
38f64f7c62
11 changed files with 89 additions and 72 deletions
|
|
@ -33,10 +33,11 @@ class Pattern:
|
|||
may reference the same Pattern object.
|
||||
:var name: An identifier for this object. Not necessarily unique.
|
||||
"""
|
||||
shapes = None # type: List[Shape]
|
||||
labels = None # type: List[Labels]
|
||||
subpatterns = None # type: List[SubPattern or GridRepetition]
|
||||
name = None # type: str
|
||||
__slots__ = ('shapes', 'labels', 'subpatterns', 'name')
|
||||
shapes: List[Shape]
|
||||
labels: List[Label]
|
||||
subpatterns: List[SubPattern or GridRepetition]
|
||||
name: str
|
||||
|
||||
def __init__(self,
|
||||
shapes: List[Shape]=(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue