Skip to content

Commit 41f254e

Browse files
authored
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)
1 parent b93f5ff commit 41f254e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rest_framework-stubs/fields.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class Field(Generic[_VT, _DT, _RP, _IN]):
7373
default: _VT | None
7474
default_empty_html: Any
7575
default_error_messages: ClassVar[dict[str, StrOrPromise]]
76-
default_validators: list[Validator[_VT]]
76+
default_validators: Sequence[Validator[_VT]]
7777
error_messages: dict[str, StrOrPromise]
7878
field_name: str | None
7979
help_text: StrOrPromise | None

0 commit comments

Comments
 (0)