Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type annotations in ApplicationModule class #7

Merged
merged 2 commits into from
May 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lato/application_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ def __init__(self, name: str):
:param name: Name of the module
"""
self.name: str = name
self._handlers: defaultdict[str, OrderedSet[Callable]] = defaultdict(OrderedSet)
self._handlers: defaultdict[HandlerAlias, OrderedSet[Callable]] = defaultdict(
OrderedSet
)
self._submodules: OrderedSet[ApplicationModule] = OrderedSet()

@property
Expand All @@ -34,7 +36,7 @@ def include_submodule(self, a_module: "ApplicationModule"):
), f"Can only include {ApplicationModule} instances, got {a_module}"
self._submodules.add(a_module)

def handler(self, alias: HandlerAlias):
def handler(self, alias: HandlerAlias) -> Callable:
"""
Decorator for registering a handler. Handler can be aliased by a name or by a message type.

Expand Down