From 3f9e61834b9b2e15a1b33d3bd386aea79c2ee439 Mon Sep 17 00:00:00 2001 From: Joseph Ware Date: Fri, 8 Mar 2024 13:40:28 +0000 Subject: [PATCH] Remove use of Annotated - get_type_hints(function) strips annotated metadata, and prevents checking for equality --- src/dodal/common/types.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/dodal/common/types.py b/src/dodal/common/types.py index d721a890ab..1eeedcfa59 100644 --- a/src/dodal/common/types.py +++ b/src/dodal/common/types.py @@ -1,5 +1,4 @@ from typing import ( - Annotated, Any, Callable, Generator, @@ -7,11 +6,9 @@ from bluesky.utils import Msg -Group = Annotated[str, "String identifier used by 'wait' or stubs that await"] -MsgGenerator = Annotated[ - Generator[Msg, Any, None], - "A true 'plan', usually the output of a generator function", -] -PlanGenerator = Annotated[ - Callable[..., MsgGenerator], "A function that generates a plan" -] +# String identifier used by 'wait' or stubs that await +Group = str +# A true 'plan', usually the output of a generator function +MsgGenerator = Generator[Msg, Any, None] +# A function that generates a plan +PlanGenerator = Callable[..., MsgGenerator]