From 031d42a75dec4a6722036f5aaf0bc9844e417360 Mon Sep 17 00:00:00 2001 From: JR Heard Date: Fri, 13 Dec 2019 22:30:50 -0800 Subject: [PATCH] update ChoiceField's `choices` kwarg's annotation (#273) per the [docs](https://docs.djangoproject.com/en/3.0/ref/forms/fields/#choicefield), `choices` is: > Either an iterable of 2-tuples to use as choices for this field, or a callable that returns such an iterable. --- django-stubs/forms/fields.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django-stubs/forms/fields.pyi b/django-stubs/forms/fields.pyi index 0594b75..566ca11 100644 --- a/django-stubs/forms/fields.pyi +++ b/django-stubs/forms/fields.pyi @@ -207,7 +207,7 @@ class CallableChoiceIterator: class ChoiceField(Field): def __init__( self, - choices: _FieldChoices = ..., + choices: Union[_FieldChoices, Callable[[], _FieldChoices]] = ..., required: bool = ..., widget: Optional[Union[Widget, Type[Widget]]] = ..., label: Optional[Any] = ...,