fix super().__call__ calls in constructors_call_metaclass#2252
Merged
carljm merged 1 commit intopython:mainfrom Apr 8, 2026
Merged
fix super().__call__ calls in constructors_call_metaclass#2252carljm merged 1 commit intopython:mainfrom
carljm merged 1 commit intopython:mainfrom
Conversation
AlexWaygood
approved these changes
Apr 8, 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.
These calls were incorrect as written, they wrongly included the explicit
clsarg, even though this is bound into the descriptor lookup;__call__is a regular method, not a static method like__new__. At runtime, the examples as written would succeed with no argument (clswould be passed asx) and fail with a single argument (two arguments passed where only one is expected).This wasn't caught by type checkers (and has no impact on the conformance results) because the use of
*args, **kwargsmeans type checkers can't track the correct arity or argument types through the metaclass__call__.Incorrect version (main branch):
Fixed version (this PR):