Skip to content

Commit 590928c

Browse files
use Sequence for default_validators (#3)
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) Co-authored-by: Anthony Sottile <[email protected]>
1 parent 87ebef3 commit 590928c

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)