entity_instance.py: fix oveloads signatures (f93d79dc)

Without `/` overload implies that it also accepts kw args, while the implementation signature doesn't support them.
This commit is contained in:
Andrej730
2026-07-14 14:33:38 +05:00
parent d728f09d86
commit 4032bbbd17
2 changed files with 14 additions and 2 deletions
@@ -409,9 +409,9 @@ class entity_instance:
@overload @overload
def is_a(self) -> str: ... def is_a(self) -> str: ...
@overload @overload
def is_a(self, ifc_class: str) -> bool: ... def is_a(self, ifc_class: str, /) -> bool: ...
@overload @overload
def is_a(self, with_schema: bool) -> str: ... def is_a(self, with_schema: bool, /) -> str: ...
def is_a(self, *args: Union[str, bool]) -> Union[str, bool]: def is_a(self, *args: Union[str, bool]) -> Union[str, bool]:
"""Return the IFC class name of an instance, or checks if an instance belongs to a class. """Return the IFC class name of an instance, or checks if an instance belongs to a class.
+12
View File
@@ -0,0 +1,12 @@
from typing import Union, overload
class entity_instance:
@overload
def is_a(self) -> str: ...
@overload
def is_a(self, ifc_class: str, /) -> bool: ...
@overload
def is_a(self, with_schema: bool, /) -> str: ...
def is_a(self, *args: Union[str, bool]) -> Union[str, bool]:
return args[0] if args else "foo"