From cb0cd93f81cd33d1345864975c070247164f55af Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Wed, 9 Oct 2024 11:21:13 -0400 Subject: [PATCH] use Sequence for default_validators while the literal in code is an empty list, it is only used as an iterable (in `get_validators`) relaxing to sequence makes it easier to use a list literal in subclasses which have a homogeneous list (without needing an explicit annotation) --- rest_framework-stubs/fields.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework-stubs/fields.pyi b/rest_framework-stubs/fields.pyi index dbb20adec..380797b34 100644 --- a/rest_framework-stubs/fields.pyi +++ b/rest_framework-stubs/fields.pyi @@ -73,7 +73,7 @@ class Field(Generic[_VT, _DT, _RP, _IN]): default: _VT | None default_empty_html: Any default_error_messages: ClassVar[dict[str, StrOrPromise]] - default_validators: list[Validator[_VT]] + default_validators: Sequence[Validator[_VT]] error_messages: dict[str, StrOrPromise] field_name: str | None help_text: StrOrPromise | None