refactor(core): give EventRouter typed handlers - #795
Merged
Conversation
janbjorge
force-pushed
the
typing/07-event-router
branch
2 times, most recently
from
September 6, 2026 17:48
4e18132 to
3b16c0f
Compare
janbjorge
force-pushed
the
typing/07-event-router
branch
from
September 6, 2026 18:17
3b16c0f to
6527864
Compare
janbjorge
force-pushed
the
typing/07-event-router
branch
from
September 6, 2026 18:24
6527864 to
0fdfa66
Compare
janbjorge
force-pushed
the
typing/07-event-router
branch
from
September 6, 2026 18:31
0fdfa66 to
e695549
Compare
janbjorge
force-pushed
the
typing/07-event-router
branch
from
September 6, 2026 18:33
e695549 to
422b9db
Compare
janbjorge
force-pushed
the
typing/07-event-router
branch
from
September 6, 2026 18:38
422b9db to
a74e559
Compare
EventRouter takes one typed handler per event type and dispatches with an exhaustive isinstance chain, so each handler receives the concrete event class and mypy proves every event type is handled. The string-keyed register() decorator is gone; it could only be typed as Callable[..., None]. default_event_router() wires the same three handlers as before.
janbjorge
force-pushed
the
typing/07-event-router
branch
from
September 6, 2026 18:41
a74e559 to
1d50927
Compare
janbjorge
added a commit
that referenced
this pull request
Sep 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 7/9 of the strict-mypy series. Stacked on #794; merge in order, I rebase the rest after each merge.
EventRouter takes one typed handler per event type and dispatches
with an exhaustive isinstance chain, so each handler receives the
concrete event class and mypy proves every event type is handled. The
string-keyed register() decorator is gone; it could only be typed as
Callable[..., None]. default_event_router() wires the same three
handlers as before.