From b97dca5d47a551a9369f6c66bb5ce87c6ea924c0 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 3 Jul 2025 17:17:54 +0500 Subject: [PATCH] typing --- src/ifcopenshell-python/ifcopenshell/geom/main.py | 2 +- .../ifcopenshell/ifcopenshell_wrapper.pyi | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/geom/main.py b/src/ifcopenshell-python/ifcopenshell/geom/main.py index 4e105b3e0a..6f4b10a3f3 100644 --- a/src/ifcopenshell-python/ifcopenshell/geom/main.py +++ b/src/ifcopenshell-python/ifcopenshell/geom/main.py @@ -55,7 +55,7 @@ if has_occ: except ImportError: from OCC import TopoDS - def wrap_shape_creation(settings, shape): + def wrap_shape_creation(settings: settings, shape: ifcopenshell_wrapper.Element): if getattr(settings, "use_python_opencascade", False): return utils.create_shape_from_serialization(shape) else: diff --git a/src/ifcopenshell-python/ifcopenshell/ifcopenshell_wrapper.pyi b/src/ifcopenshell-python/ifcopenshell/ifcopenshell_wrapper.pyi index 07a42246ba..2caa9757a6 100644 --- a/src/ifcopenshell-python/ifcopenshell/ifcopenshell_wrapper.pyi +++ b/src/ifcopenshell-python/ifcopenshell/ifcopenshell_wrapper.pyi @@ -313,7 +313,10 @@ class Iterator: def create(self): ... def file(self): ... def filters(self, *args): ... - def get(self): ... + def get(self) -> Element: + """Get last processed element.""" + ... + def getLog(self): ... def get_native(self): ... def get_object(self, id): ... @@ -322,7 +325,14 @@ class Iterator: """Return true if the iterator is initialized with any elements, false otherwise.""" ... - def next(self): ... + def next(self) -> Union[entity_instance, None]: + """Process next shape representation. + + :return: Processed ``entity_instance`` or ``None`` if nothing is left to process. + + """ + ... + def process_concurrently(self): ... def process_finished_rep(self, rep): ... def progress(self) -> int: