Skip to content

Commit fcb8e1f

Browse files
yt-msMidnighter
authored andcommitted
style: PR feedback
1 parent 1d6c521 commit fcb8e1f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/structurizr/model/component.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class Component(StaticStructureElement):
8282
def __init__(
8383
self,
8484
*,
85-
parent: "Container" = None,
85+
parent: Optional["Container"] = None,
8686
technology: str = "",
8787
code_elements: Iterable[CodeElement] = (),
8888
size: Optional[int] = None,
@@ -109,7 +109,7 @@ def __init__(
109109

110110
@classmethod
111111
def hydrate(cls, component_io: ComponentIO, container: "Container") -> "Component":
112-
""""""
112+
"""Create and hydrate a new `Component` instance from its IO."""
113113
return cls(
114114
**cls.hydrate_arguments(component_io),
115115
parent=container,

src/structurizr/model/container.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class Container(StaticStructureElement):
7979
def __init__(
8080
self,
8181
*,
82-
parent: "SoftwareSystem" = None,
82+
parent: Optional["SoftwareSystem"] = None,
8383
technology: str = "",
8484
components: Iterable[Component] = (),
8585
**kwargs,
@@ -105,7 +105,7 @@ def __init__(
105105
@property
106106
def components(self) -> Iterable[Component]:
107107
"""Return read-only list of child components."""
108-
return [c for c in self._components]
108+
return list(self._components)
109109

110110
@classmethod
111111
def hydrate(
@@ -144,7 +144,7 @@ def __iadd__(self, component: Component) -> "Container":
144144

145145
if self.get_component_with_name(component.name):
146146
raise ValueError(
147-
f"Component with name {component.name} already exists for {self}."
147+
f"Component with name {component.name} already exists in {self}."
148148
)
149149

150150
if component.parent is None:

0 commit comments

Comments
 (0)