Repository navigation
Restore class-valued hook specifications - #795
Closed
adenzhou1350 wants to merge 3 commits into
Closed
adenzhou1350 wants to merge 3 commits into
adenzhou1350 wants to merge 3 commits into
Conversation
Signed-off-by: Xucheng Zhou <aden1350@outlook.com>
added 2 commits
October 15, 2026 21:44
Signed-off-by: Xucheng Zhou <aden1350@outlook.com>
Signed-off-by: Xucheng Zhou <aden1350@outlook.com>
Member
|
this is a prime example of what destroys opensource - unattended ai slop adding a fix that eats review time when the only correct answer is - no this never was intended the person operating the bot should be ashamed of their behavior |
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.
Fixes #794.
PluginCode decorates a class as a hookspec. The static-discovery change in 1.7.0 stopped recognizing that class, so
add_hookspecs()raisesValueError.Restore class-valued specifications without changing hook implementation discovery or evaluating properties/other descriptors. For a class signature, read defaults from its
__init__, matching the callable already inspected byvarnames(). Classes usingobject.__init__have no defaults. Keep the original class inHookSpec.function.Tests cover module/class/instance namespaces and implicit, required, defaulted, inherited and wrapped constructors. They verify argument metadata, explicit/default hook calls, and that constructors are never executed. A control preserves the existing behavior of ignoring class-valued hook implementations.
Validation
Reproduction context: #794 (comment)
AI-assisted implementation and validation.