diff --git a/src/ifcopenshell-python/ifcopenshell/entity_instance.py b/src/ifcopenshell-python/ifcopenshell/entity_instance.py index fe7608de0b..46fef0a37f 100644 --- a/src/ifcopenshell-python/ifcopenshell/entity_instance.py +++ b/src/ifcopenshell-python/ifcopenshell/entity_instance.py @@ -409,9 +409,9 @@ class entity_instance: @overload def is_a(self) -> str: ... @overload - def is_a(self, ifc_class: str) -> bool: ... + def is_a(self, ifc_class: str, /) -> bool: ... @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]: """Return the IFC class name of an instance, or checks if an instance belongs to a class. diff --git a/ty.py b/ty.py new file mode 100644 index 0000000000..10c33ee524 --- /dev/null +++ b/ty.py @@ -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"