jolpica / jolpica-f1

Apache License 2.0
41 stars 1 forks source link

Fix incorrect type hints in to_representation signature #53

Closed theOehrly closed 2 months ago

theOehrly commented 2 months ago

Why are you making this change?

Type hints in the signature are incorrect.

As per https://github.com/encode/django-rest-framework/blob/fe92f0dd0d4c587eed000c7de611ddbff241bd6a/rest_framework/serializers.py#L707 and manual verification at runtime, ListSerializer.to_representation() takes a list of instances, not a query set.

Contributing Checklist

theOehrly commented 2 months ago

Looking at the source code, contrary to the doc string, it might not always be a list. But it certainly isn't a QuerySet,