diff --git a/src/heros/__init__.py b/src/heros/__init__.py index 43ce84b7e8565abc6700032da0872348616b17fb..fa0eae2c48604f2d988430dcf73643d5b5fd9358 100644 --- a/src/heros/__init__.py +++ b/src/heros/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.8.6" +__version__ = "0.8.7" __proto_version__ = 1.0 from .heros import HEROPeer, RemoteHERO, LocalHERO, EventObserver, HEROObserver diff --git a/src/heros/capabilities.py b/src/heros/capabilities.py index 9f360b570d6834c88a244b6396a40302bab5f32c..18f75e500841511fd6492a77d5fd344578b78ab0 100644 --- a/src/heros/capabilities.py +++ b/src/heros/capabilities.py @@ -13,7 +13,7 @@ if typing.TYPE_CHECKING: from zenoh import Query -def type_to_str(annotation) -> str: +def type_to_str(annotation: type | str) -> str: """ Transforms annotation given as `types` to strings. @@ -24,7 +24,9 @@ def type_to_str(annotation) -> str: Annotation as string. """ if annotation is not inspect.Parameter.empty: - if isinstance(annotation, UnionType): + if type(annotation) is str: + return annotation + elif isinstance(annotation, UnionType): return repr(annotation) else: return annotation.__name__