-
-
Notifications
You must be signed in to change notification settings - Fork 133
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug report
What's wrong
The type stubs do not allow to_representation to be given None, even though this is valid.
from rest_framework import serializers
serializers.DateField(allow_null=True).to_representation(None)mypy error:
Argument 1 to "to_representation" of "Field" has incompatible type "None"; expected "date" [arg-type]
How is that should be
None should be a supported value type for serializers.
System information
- OS: PopOS 22.04
pythonversion: 3.11.4djangoversion: 4.2.7mypyversion: 1.6.1django-stubsversion: 4.2.6
intgr
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working