library can generate abstracts
This commit is contained in:
parent
09b7ecd80e
commit
2302d29433
@ -22,6 +22,7 @@ from .label import Label
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .pattern import Pattern
|
||||
from .builder import Abstract
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@ -41,6 +42,9 @@ class Library(Mapping[str, Pattern], metaclass=ABCMeta):
|
||||
|
||||
#__contains__, keys, items, values, get, __eq__, __ne__ supplied by Mapping
|
||||
|
||||
def abstract(self, name: str) -> 'Abstract':
|
||||
return Abstract(name=name, ports=self[name].ports)
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return '<Library with keys ' + repr(list(self.keys())) + '>'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user