Make Delegate classes proper ABCs with abstract methods#602
Merged
gnachman merged 1 commit intognachman:masterfrom Mar 2, 2026
Merged
Make Delegate classes proper ABCs with abstract methods#602gnachman merged 1 commit intognachman:masterfrom
gnachman merged 1 commit intognachman:masterfrom
Conversation
All four Delegate classes (tmux.Delegate, Session.Delegate, Tab.Delegate, Window.Delegate) used @abc.abstractmethod on methods but did not inherit from abc.ABC, so the decorator had no effect. - Add abc.ABC as base class to all four Delegate classes - Add ellipsis (...) as method body for all abstract methods - Remove misplaced @abc.abstractmethod class decorator from tmux.Delegate and add it to individual methods instead The only subclass (App) already implements all required methods.
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.
Summary
All four Delegate classes in the Python API use
@abc.abstractmethodon their methods but don't inherit fromabc.ABC, so the decorator has no effect — subclasses are not required to implement the methods.Additionally,
tmux.Delegatehad@abc.abstractmethodas a class decorator (which is a no-op) instead of on individual methods.Changes:
tmux.Delegate: Remove misplaced@abc.abstractmethodclass decorator, inherit fromabc.ABC, add@abc.abstractmethodto each methodSession.Delegate: Inherit fromabc.ABCTab.Delegate: Inherit fromabc.ABCWindow.Delegate: Inherit fromabc.ABC...(ellipsis) as method body to all abstract methodsThe only subclass (
App) already implements all required methods across all four Delegates.