From 50bbe849ffc1f64e908929f20ac138fe85d3951c Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Fri, 17 Nov 2023 18:57:51 +0500 Subject: [PATCH] minor fix to support union typing before python 3.10 #3774 --- src/ifcopenshell-python/ifcopenshell/util/representation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/util/representation.py b/src/ifcopenshell-python/ifcopenshell/util/representation.py index 455bf1f0a8..436c83b5c3 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/representation.py +++ b/src/ifcopenshell-python/ifcopenshell/util/representation.py @@ -19,7 +19,7 @@ from __future__ import annotations import numpy as np import ifcopenshell -from typing import Any +from typing import Any, Union from dataclasses import dataclass @@ -99,7 +99,7 @@ class ClippingInfo: operand_type: str = "IfcHalfSpaceSolid" @classmethod - def parse(cls, raw_data: Any) -> ifcopenshell.entity_instance | ClippingInfo | None: + def parse(cls, raw_data: Any) -> Union[ifcopenshell.entity_instance, ClippingInfo, None]: """`raw_data` can be either: - IfcBooleanResult IFC entity - `ClippingInfo` instance