mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-10 06:00:51 +00:00
Fix Python <3.10 support #6141
This commit is contained in:
@@ -18,12 +18,13 @@
|
|||||||
|
|
||||||
import ifcopenshell.api.geometry
|
import ifcopenshell.api.geometry
|
||||||
import ifcopenshell.util.representation
|
import ifcopenshell.util.representation
|
||||||
|
from typing import Union
|
||||||
|
|
||||||
|
|
||||||
def validate_type(
|
def validate_type(
|
||||||
file: ifcopenshell.file,
|
file: ifcopenshell.file,
|
||||||
representation: ifcopenshell.entity_instance,
|
representation: ifcopenshell.entity_instance,
|
||||||
preferred_item: ifcopenshell.entity_instance | None = None,
|
preferred_item: Union[ifcopenshell.entity_instance, None] = None,
|
||||||
) -> bool:
|
) -> bool:
|
||||||
"""Validates the RepresentationType of an IfcShapeRepresentation
|
"""Validates the RepresentationType of an IfcShapeRepresentation
|
||||||
|
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ def get_representation(
|
|||||||
return r
|
return r
|
||||||
|
|
||||||
|
|
||||||
def guess_type(items: Sequence[ifcopenshell.entity_instance]) -> str | None:
|
def guess_type(items: Sequence[ifcopenshell.entity_instance]) -> Union[str, None]:
|
||||||
"""Guesses the appropriate RepresentationType attribute based on a list of items
|
"""Guesses the appropriate RepresentationType attribute based on a list of items
|
||||||
|
|
||||||
:param items: A list of IfcRepresentationItem, typically in an IfcShapeRepresentation
|
:param items: A list of IfcRepresentationItem, typically in an IfcShapeRepresentation
|
||||||
|
|||||||
Reference in New Issue
Block a user