Skip to content

Commit

Permalink
use Sequence for default_validators (#680)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
asottile authored Oct 10, 2024
1 parent b93f5ff commit 41f254e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rest_framework-stubs/fields.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 41f254e

Please sign in to comment.