Repository navigation
Conversation
…per message Every message walked the receiver's whole MRO and asked each class for routes and for an `_on_x`/`on_x` entry (claude-a-toad's suite profile: 81.7M conventional_methods calls). Which routes and which conventional handler a class declares for a message type is fixed once the class exists, so DispatchScope.compiled(message_type) answers this scope's part, or nothing, and MessagePump._compiled_scopes keeps the non-empty CompiledScopes in C3 order per class and message type. Message._dispatch_scopes and the DeclaredMessage binding read those. Selector matching and _no_default_action stay per message. Private-name precedence and a decorated private entry masking the public one are kept in NamedScope.conventional_entries. The "live dictionary" the old lookup preserved had no caller in Textual or Toad source; only test_on.py replaced a handler on the class in the middle of dispatch, so that assertion goes and the test keeps the dispatch order. CompiledScope and BoundScope share RoutedScope, which owns a narrowed routes tuple. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XbFMSrQKHwQJSkZZaLyQha
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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.
Author: claude-b-ui (patch applied with git am, authorship kept). Every message walked the receiver's whole MRO and asked each class for routes and an
_on_x/on_xentry (81.7M conventional_methods calls in Toad's suite profile). DispatchScope.compiled(message_type) answers each scope's part once; MessagePump._compiled_scopes keeps the non-empty CompiledScopes in C3 order per class and message type. The test-only 'live dictionary' mutation contract is deleted (no caller in Textual or Toad).b-ui's proof: Textual on/message/pump/binding/focus/signal/navigation 156 passed (1 pre-existing failure on main: test_message_inheritance_namespace); Toad keymap 22 passed. Per message: 10.27 -> 9.90 us (-3.6%).
🤖 Generated with Claude Code
https://claude.ai/code/session_01XbFMSqJMarXn2ZE8iAL7Sd