Skip to content

Commit

Permalink
Merge pull request #7 from artemyfmv/fix-app-module-type-annotations
Browse files Browse the repository at this point in the history
Fix type annotations in `ApplicationModule` class
  • Loading branch information
pgorecki authored May 29, 2024
2 parents 4c5f0ec + 1df4f74 commit 35727f1
Showing 1 changed file with 4 additions and 2 deletions.
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

0 comments on commit 35727f1

Please sign in to comment.