Enhance typing for KeyValueForm.
Review Request #14437 — Created May 13, 2025 and submitted — Latest diff uploaded
This change makes it so KeyValueForm is typed as a generic, allowing us
to specify the type of theinstance
member which is operated on. The
default implementations of get and set assume a dict-like interface, so
I've additionally added some runtime-checkable protocols for those.
- Ran unit tests.
- Verified that type checkers were happy when creating KeyValueForm
subclasses.
Diff Revision 2
This is not the most recent revision of the diff. The latest diff is revision 4. See what's changed.
orig
1
2
3
4
Commits
djblets/extensions/forms.py |
---|
djblets/forms/forms/key_value_form.py |
---|
djblets/integrations/forms.py |
---|
djblets/siteconfig/forms.py |
---|