From 0412eb48a06cc153a4910acabfbdb840dfd42e64 Mon Sep 17 00:00:00 2001 From: CyrilWaechter Date: Tue, 22 Nov 2022 01:00:04 +0100 Subject: [PATCH] Fix type hints #2350 for python <3.10 --- src/ifcopenshell-python/ifcopenshell/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/__init__.py b/src/ifcopenshell-python/ifcopenshell/__init__.py index c83183e66a..93571e3c74 100644 --- a/src/ifcopenshell-python/ifcopenshell/__init__.py +++ b/src/ifcopenshell-python/ifcopenshell/__init__.py @@ -83,7 +83,7 @@ class SchemaError(Error): pass -def guess_format(path): +def guess_format(path: Path) -> "str | None": """Try to guess format using file extension""" if path.suffix.lower() in (".ifczip", ".zip"): return ".ifcZIP" @@ -91,7 +91,7 @@ def guess_format(path): return ".ifcXML" -def open(path: os.PathLike | str, format: str = None) -> file: +def open(path: "os.PathLike | str", format: str = None) -> file: """Loads an IFC dataset from a filepath You can specify a file format. If no format is given, it is guessed from its extension.