You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Type of "self.validators" is "list[((Any) -> None) | ContextValidator[Any]]"
This is the result of reveal_type(self.validators) on an instance of ModelSerializer. I don't see it explicitly defined in serializers.pyi so I am not sure where exactly it is coming from.
When evaluating the elements of the list against UniqueTogetherValidator mypy reports that the condition always returns False.
None of the Unique... validators are a type that is mentioned above so that is my assumption why that is.
How is that should be
The type for the validators property should include the Unique... validators (at least for ModelSerializer).
System information
OS:
python version: 3.122
django version: 4.2.11
mypy version: 1.8.0
django-stubs version: 4.2.7
The text was updated successfully, but these errors were encountered:
Bug report
What's wrong
The
Serializer.validators
property has the typeThis is the result of
reveal_type(self.validators)
on an instance ofModelSerializer
. I don't see it explicitly defined inserializers.pyi
so I am not sure where exactly it is coming from.When evaluating the elements of the list against
UniqueTogetherValidator
mypy reports that the condition always returnsFalse
.None of the Unique... validators are a type that is mentioned above so that is my assumption why that is.
How is that should be
The type for the
validators
property should include theUnique...
validators (at least forModelSerializer
).System information
python
version: 3.122django
version: 4.2.11mypy
version: 1.8.0django-stubs
version: 4.2.7The text was updated successfully, but these errors were encountered: