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

Fix class hierachy and TypeVars of Serializer classes #520

Merged
merged 2 commits into from
May 2, 2024

Conversation

intgr
Copy link
Contributor

@intgr intgr commented Dec 8, 2023

I have made thunks!

  • ModelSerializer was incorrectly deriving from Serializer[Any] and BaseSerializer[T]; replaced with Serializer[T].
    This brings it into sync with DRF upstream.

  • Added TypeVar to HyperlinkedModelSerializer class.

  • Removed unnecessary Generic[] where implicit TypeVars are sufficient.

    https://mypy.readthedocs.io/en/stable/generics.html#defining-subclasses-of-generic-classes

    If there are no Generic[...] in bases, then all type variables are collected in the lexicographic order (i.e. by first appearance).

@intgr intgr changed the title Fix and clean up TypeVars of Serializer classes Fix class hierachy and TypeVars of Serializer classes Mar 19, 2024
intgr added 2 commits April 27, 2024 13:02
* Remove unnecessary `Generic[]` where implicit TypeVars are sufficient.
* `ModelSerializer` was incorrectly deriving from `Serializer[Any]` and `BaseSerializer`
@intgr intgr force-pushed the fix-cleanup-serializer-typevars branch from b51d616 to 9179c7d Compare April 27, 2024 10:02
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.

Thank you!

@intgr intgr merged commit 9970b74 into typeddjango:master May 2, 2024
12 checks passed
@intgr intgr deleted the fix-cleanup-serializer-typevars branch May 2, 2024 08:12
@intgr
Copy link
Contributor Author

intgr commented May 2, 2024

Oops, I missed the notification that this got apprpoved. Thanks

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.

2 participants