From d96aee7a8ba3519eb72e01e807cc8de739ae8dfb Mon Sep 17 00:00:00 2001 From: Brian Helba Date: Fri, 7 Feb 2020 04:42:02 -0500 Subject: [PATCH] Fix the type of form.Field.widget (#321) The `widget` class attribute of `form.Field` expects a `Widget` class, not an instance of `Widget`. See: https://docs.djangoproject.com/en/3.0/ref/forms/fields/#widget Also usages at: https://github.com/django/django/blob/3259983f569151232d8e3b0c3d0de3a858c2b265/django/forms/fields.py#L46 --- 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 566ca11..5a56320 100644 --- a/django-stubs/forms/fields.pyi +++ b/django-stubs/forms/fields.pyi @@ -14,7 +14,7 @@ class Field: initial: Any label: Optional[str] required: bool - widget: Widget = ... + widget: Type[Widget] = ... hidden_widget: Any = ... default_validators: Any = ... default_error_messages: Any = ...