We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 23adc52 commit fb87815Copy full SHA for fb87815
1 file changed
pyoverkiz/models.py
@@ -798,13 +798,6 @@ class HistoryExecution:
798
execution_sub_type: ExecutionSubType = field(converter=ExecutionSubType)
799
800
801
-def _to_sub_places(items: list[Any] | None) -> list[Any]:
802
- """Converter for Place.sub_places (self-referencing)."""
803
- if not items:
804
- return []
805
- return [Place(**p) if isinstance(p, dict) else p for p in items]
806
-
807
808
@_flexible_init
809
@define(kw_only=True)
810
class Place:
@@ -821,7 +814,7 @@ class Place:
821
814
label: str
822
815
type: int
823
816
oid: str
824
- sub_places: list[Place] = field(factory=list, converter=_to_sub_places)
817
+ sub_places: list[Place] = field(factory=list, converter=_to_list("Place"))
825
818
id: str = field(init=False)
826
819
827
820
def __attrs_post_init__(self) -> None:
0 commit comments