Let layer be a tuple of ints (or just a single int like before)

This commit is contained in:
jan 2017-08-12 19:31:02 -07:00
parent 0a7c26bb08
commit b99509289a

View File

@ -120,20 +120,16 @@ class Shape(metaclass=ABCMeta):
# layer property # layer property
@property @property
def layer(self) -> int: def layer(self) -> int or Tuple[int]:
""" """
Layer number (int, >=0) Layer number (int or tuple of ints)
:return: Layer :return: Layer
""" """
return self._layer return self._layer
@layer.setter @layer.setter
def layer(self, val: int): def layer(self, val: int or List[int]):
if not isinstance(val, int):
raise PatternError('Layer must be an integer')
if not val >= 0:
raise PatternError('Layer must be non-negative')
self._layer = val self._layer = val
# dose property # dose property