repetition related fixup
This commit is contained in:
parent
bab40474a0
commit
794ebb6b37
11 changed files with 112 additions and 68 deletions
|
|
@ -1,4 +1,4 @@
|
|||
from typing import List, Tuple, Callable, TypeVar, Optional
|
||||
from typing import List, Tuple, Callable, TypeVar, Optional, TYPE_CHECKING
|
||||
from abc import ABCMeta, abstractmethod
|
||||
import copy
|
||||
import numpy
|
||||
|
|
@ -6,6 +6,10 @@ import numpy
|
|||
from ..error import PatternError, PatternLockedError
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..repetition import Repetition
|
||||
|
||||
|
||||
T = TypeVar('T', bound='Repeatable')
|
||||
I = TypeVar('I', bound='RepeatableImpl')
|
||||
|
||||
|
|
@ -27,14 +31,15 @@ class Repeatable(metaclass=ABCMeta):
|
|||
"""
|
||||
pass
|
||||
|
||||
@repetition.setter
|
||||
@abstractmethod
|
||||
def repetition(self, repetition: Optional['Repetition']):
|
||||
pass
|
||||
# @repetition.setter
|
||||
# @abstractmethod
|
||||
# def repetition(self, repetition: Optional['Repetition']):
|
||||
# pass
|
||||
|
||||
'''
|
||||
---- Methods
|
||||
'''
|
||||
@abstractmethod
|
||||
def set_repetition(self: T, repetition: Optional['Repetition']) -> T:
|
||||
"""
|
||||
Set the repetition
|
||||
|
|
@ -74,6 +79,6 @@ class RepeatableImpl(Repeatable, metaclass=ABCMeta):
|
|||
'''
|
||||
---- Non-abstract methods
|
||||
'''
|
||||
def set_repetition(self: I, repetition: 'Repetition') -> I:
|
||||
def set_repetition(self: I, repetition: Optional['Repetition']) -> I:
|
||||
self.repetition = repetition
|
||||
return self
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue