From 41f254efe691b27c9a63c1765d4bfffab3daf39b Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 10 Oct 2024 03:17:54 -0400 Subject: [PATCH] use Sequence for default_validators (#680) 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 255bbae53..3f88b2220 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