diff --git a/eventforge/observers.py b/eventforge/observers.py index b6eebcc..2be4430 100644 --- a/eventforge/observers.py +++ b/eventforge/observers.py @@ -721,8 +721,8 @@ def _register_class_subscriber( # Each entry: (attr_name, ((target_cls, event), ...)) -- the @observe targets # placed on the Reporter method. -ObserveTargets = tuple[tuple[type, str], ...] -ReporterMethods = tuple[tuple[str, ObserveTargets], ...] +ObserveTargets = Tuple[Tuple[type, str], ...] +ReporterMethods = Tuple[Tuple[str, ObserveTargets], ...] _REPORTER_OBSERVE_METHODS: weakref.WeakKeyDictionary[type, ReporterMethods] = ( weakref.WeakKeyDictionary() diff --git a/eventforge/queue.py b/eventforge/queue.py index cf0dadc..617bc86 100644 --- a/eventforge/queue.py +++ b/eventforge/queue.py @@ -17,8 +17,10 @@ from __future__ import annotations import threading -from collections.abc import Callable -from typing import Any, Dict, List, Optional, Tuple, Union, overload + +# ``Callable`` is subscripted at runtime in the Handler aliases below; the +# typing alias is required on Python 3.8 (collections.abc generics are 3.9+). +from typing import Any, Callable, Dict, List, Optional, Tuple, Union, overload from uuid import uuid4 from eventforge.observers import BroadcastDispatcher, Dispatcher, Eventful, Observable diff --git a/eventforge/task.py b/eventforge/task.py index d716add..aacfb60 100644 --- a/eventforge/task.py +++ b/eventforge/task.py @@ -6,8 +6,10 @@ import logging import threading import time -from collections.abc import Callable -from typing import Any, Dict, List, Optional, Protocol, Tuple, cast + +# ``Callable`` is subscripted at runtime in the ContextHandler alias below; the +# typing alias is required on Python 3.8 (collections.abc generics are 3.9+). +from typing import Any, Callable, Dict, List, Optional, Protocol, Tuple, cast from uuid import uuid4 from eventforge.executor import ExecutionMode, Executor