Skip to content

Commit fb87815

Browse files
committed
Replace _to_sub_places with _to_list("Place") forward reference
1 parent 23adc52 commit fb87815

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

pyoverkiz/models.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -798,13 +798,6 @@ class HistoryExecution:
798798
execution_sub_type: ExecutionSubType = field(converter=ExecutionSubType)
799799

800800

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-
808801
@_flexible_init
809802
@define(kw_only=True)
810803
class Place:
@@ -821,7 +814,7 @@ class Place:
821814
label: str
822815
type: int
823816
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"))
825818
id: str = field(init=False)
826819

827820
def __attrs_post_init__(self) -> None:

0 commit comments

Comments
 (0)