diff --git a/mesa/experimental/signals/signal.py b/mesa/experimental/signals/signal.py index a750ab8237f..fda0ae4159d 100644 --- a/mesa/experimental/signals/signal.py +++ b/mesa/experimental/signals/signal.py @@ -1,5 +1,7 @@ """Core classes for Observables.""" +from __future__ import annotations + import contextlib import functools import itertools @@ -9,9 +11,9 @@ from collections.abc import Callable from typing import Any -__all__ = ["Observable", "HasObservables"] +__all__ = ["Observable", "HasObservables", "All", "Computable"] -CURRENT_COMPUTED: "Computed" | None = None # the current Computed that is evaluating +CURRENT_COMPUTED: Computed | None = None # the current Computed that is evaluating class BaseObservable(ABC): @@ -245,7 +247,7 @@ def __deepcopy__(self, memo): class HasObservables: """HasObservables class.""" - observables: dict[str, Observable] = {} + observables: dict[str, BaseObservable] = {} subscribers: dict[str, dict[str, weakref.WeakSet]] def __new__(cls, *args, **kwargs): # noqa D102