mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
typing
This commit is contained in:
@@ -25,7 +25,7 @@ import operator
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
from typing import Union, Any, Callable, TypeVar, overload, Iterable
|
||||
from typing import Union, Any, Callable, TypeVar, overload, Iterable, Sequence
|
||||
|
||||
from . import ifcopenshell_wrapper
|
||||
from . import settings
|
||||
@@ -551,7 +551,7 @@ class entity_instance:
|
||||
include_identifier: bool = True,
|
||||
recursive: bool = False,
|
||||
return_type: Union[type[dict], type] = dict,
|
||||
ignore: Iterable[str] = (),
|
||||
ignore: Sequence[str] = (),
|
||||
scalar_only: bool = False,
|
||||
) -> dict[str, Any]:
|
||||
"""Return a dictionary of the entity_instance's properties (Python and IFC) and their values.
|
||||
|
||||
@@ -28,7 +28,7 @@ from ..entity_instance import entity_instance
|
||||
|
||||
from . import has_occ
|
||||
|
||||
from typing import TypeVar, Union, Optional, Generator, Any, Literal, overload, TYPE_CHECKING, Iterable
|
||||
from typing import TypeVar, Union, Optional, Generator, Any, Literal, overload, TYPE_CHECKING, Iterable, cast
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from OCC.Core import TopoDS
|
||||
@@ -262,6 +262,8 @@ class iterator(ifcopenshell_wrapper.Iterator):
|
||||
include_or_exclude_type = set(x.__class__.__name__ for x in include_or_exclude)
|
||||
|
||||
if include_or_exclude_type == {"entity_instance"}:
|
||||
include_or_exclude = cast(set[entity_instance], include_or_exclude)
|
||||
|
||||
if not all(inst.is_a("IfcProduct") for inst in include_or_exclude):
|
||||
raise ValueError("include and exclude need to be an aggregate of IfcProduct")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user