-
-
Notifications
You must be signed in to change notification settings - Fork 521
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug report
For the type django.db.models.fields.formfield.Field, the function formfield currently has the following type.
def formfield(self, form_class: Any | None = ..., choices_form_class: Any | None = ..., **kwargs: Any) -> Any: ...What's wrong
The form_class attribute is type[forms.Field], and the return value is forms.Field:
def formfield(self, form_class: type[forms.Field] | None = ..., choices_form_class: Any | None = ..., **kwargs: Any) -> forms.Field: ...How is that should be
This isn't specific enough: the return value is of the same type of form_class, so there is a relationship between the two.
However, I'm not sure how to represent this type relationship. Should I use a Protocol for the entire type?
System information
Current master of this project. All else is out of scope here.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working