Files
speckle_automate_python_exa…/flatten.py
Gergő Jedlicska f4fdcb9272 initial commit
2023-06-22 12:32:34 +02:00

9 lines
244 B
Python

from typing import Iterable
from specklepy.objects import Base
def flatten_base(base: Base) -> Iterable[Base]:
if hasattr(base, "elements"):
for element in base.elements:
yield from flatten_base(element)
yield base