djangorestframework-stubs
djangorestframework-stubs copied to clipboard
Fix and clean up TypeVars of Serializer classes
I have made thunks!
-
ModelSerializerwas incorrectly deriving fromSerializer[Any]andBaseSerializer[T]; replaced withSerializer[T]. -
Added TypeVar to
HyperlinkedModelSerializerclass. -
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).