-
-
Notifications
You must be signed in to change notification settings - Fork 131
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug report
What's wrong
The return type of Field.get_attribute() is declared as _RP, but I think it should be _VT.
How is that should be
Looking at the implementation of Serializer.to_representation(), the value returned by Field.get_attribute() is passed to Field.to_representation(), whose argument is declared to be _VT. Thus I think the declaration of Field.get_attribute() should be changed to:
def get_attribute(self, instance: _IN) -> _VT | None: ...System information
- OS: macOS 14.8
pythonversion: Python 3.12.11djangoversion: 4.2.24mypyversion: 1.15.0django-stubsversion: 5.2.5
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working