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
|
|
@ -14,15 +14,15 @@ class Label:
|
|||
"""
|
||||
A circle, which has a position and radius.
|
||||
"""
|
||||
|
||||
__slots__ = ('_offset', '_layer', '_string', 'identifier')
|
||||
# [x_offset, y_offset]
|
||||
_offset = numpy.array([0.0, 0.0]) # type: numpy.ndarray
|
||||
_offset: numpy.ndarray
|
||||
|
||||
# Layer (integer >= 0)
|
||||
_layer = 0 # type: int or Tuple
|
||||
# Layer (integer >= 0) or 2-Tuple of integers
|
||||
_layer: int or Tuple
|
||||
|
||||
# Label string
|
||||
_string = None # type: str
|
||||
_string: str
|
||||
|
||||
# Arbitrary identifier tuple
|
||||
identifier: Tuple
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue