From 1c1bf56893f6f2c3f6e6d1c8c49bc0f777ab3e0c Mon Sep 17 00:00:00 2001 From: Andrej Date: Wed, 28 May 2025 14:53:07 +0500 Subject: [PATCH] typing --- src/ifcopenshell-python/ifcopenshell/util/pset.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/util/pset.py b/src/ifcopenshell-python/ifcopenshell/util/pset.py index 025f9f042c..c094ab7893 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/pset.py +++ b/src/ifcopenshell-python/ifcopenshell/util/pset.py @@ -44,13 +44,15 @@ class PsetQto: "IFC4X3_ADD2": "Pset_IFC4X3.ifc" } # fmt: on + templates: list[ifcopenshell.file] - def __init__(self, schema_identifier: str, templates=None) -> None: + def __init__(self, schema_identifier: str, templates: Optional[list[ifcopenshell.file]] = None) -> None: self.schema = ifcopenshell.schema_by_name(schema_identifier) if not templates: folder_path = pathlib.Path(__file__).parent.absolute() path = str(folder_path.joinpath("schema", self.templates_path[schema_identifier])) - templates = [ifcopenshell.open(path)] + ifc_file: ifcopenshell.file = ifcopenshell.open(path) + templates = [ifc_file] # See bug 3583. We backport this change from IFC4X3 because it just makes sense. # Users aren't forced to use it. if schema_identifier == "IFC4":