Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do models.Model adjustments from get_metaclass_hook #2322

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

flaeppe
Copy link
Member

@flaeppe flaeppe commented Aug 6, 2024

The called hook expects/wants the class body analyzed, but the get_customize_class_mro_hook hook, that it was previously called from, invokes the hook before the class body has been analyzed..

Docs: https://mypy.readthedocs.io/en/stable/extending_mypy.html#current-list-of-plugin-hooks

get_customize_class_mro_hook() can be used to modify class MRO (for example insert some entries there) before the class body is analyzed.

Related issues

The called hook expects/wants the class body analyzed, but the
`get_customize_class_mro_hook` hook, that it was previously called from,
invokes the hook before the class body has been analyzed..
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I think that we didn't have this hook back in the days of the original code.

@sobolevn sobolevn merged commit ac2b526 into typeddjango:master Aug 6, 2024
36 checks passed
@flaeppe flaeppe deleted the fix/2304 branch August 6, 2024 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

[5.0.3 regression] error: "type[RealmFilter]" has no attribute "objects" [attr-defined]
2 participants