djangorestframework-stubs icon indicating copy to clipboard operation
djangorestframework-stubs copied to clipboard

Fix and clean up TypeVars of Serializer classes

Open intgr opened this issue 2 years ago • 0 comments

I have made thunks!

  • ModelSerializer was incorrectly deriving from Serializer[Any] and BaseSerializer[T]; replaced with Serializer[T].

  • 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 avatar Dec 08 '23 15:12 intgr