From cb210a6b95cf167a47a55f5c610753e2ffc2135c Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 15 Dec 2025 13:01:01 +0100 Subject: [PATCH 1/2] type_to_str can also take str --- src/heros/capabilities.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/heros/capabilities.py b/src/heros/capabilities.py index 9f360b5..4f3072d 100644 --- a/src/heros/capabilities.py +++ b/src/heros/capabilities.py @@ -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__ -- GitLab From 1f75c900463f96a21041c8ed15bb0ea467507354 Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 15 Dec 2025 13:13:04 +0100 Subject: [PATCH 2/2] bumped version str --- src/heros/__init__.py | 2 +- src/heros/capabilities.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/heros/__init__.py b/src/heros/__init__.py index 43ce84b..fa0eae2 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 4f3072d..18f75e5 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. -- GitLab