[Proposal / RFC] Align Mixin instance_init signature with Invocable instance_init signature#522
Merged
Conversation
…gentService instances
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.
Context
We've been discussing ways to simplify the
Confighandling requirements across mixins and packages.One complexity identified is that configs of different types were being passed around automatically at different times.
This PR
This PR removes all arguments from the Mixin's
instance_initmethod, bringing it into alignment with PackageService.This simplifies the contract of a Mixin's state without impacting possibility: the state would not be provided exclusively upon instantiation, by the PackageService author. 100% of the state it needs must be provided at that time.
Mixins affected
This only affects the Telegram mixin, but it turns out that that Mixin already had -- via its
__init__method -- all of the information that it just lost by simplifying theinstance_initmethod.Implied "Best Practice" Mixin Configuration Pattern
This results in a situation where we do not need to commingle MixinConfig and PackageConfig.
The following manner of configuration can now keep the two configuration layers completely separate, ducking around multi-inheritance issues with Pydantic: