Skip to content

Commit 4dd27d7

Browse files
committed
Improve MultiValueDict/QueryDict dict() return
According to Django documentation and code, the `MultiValueDict.dict()` method only returns singular values for each key, never a list. https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.QueryDict.dict https://github.com/django/django/blob/3de787a70b6c140a3b1289a8ce12b17ebcb8a200/django/utils/datastructures.py#L215-L217
1 parent 4e3f9d6 commit 4dd27d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

django-stubs/utils/datastructures.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class MultiValueDict(MutableMapping[_K, _V]):
4343
def setlistdefault(self, key: _K, default_list: Optional[List[_V]] = ...) -> List[_V]: ...
4444
def appendlist(self, key: _K, value: _V) -> None: ...
4545
def lists(self) -> Iterable[Tuple[_K, List[_V]]]: ...
46-
def dict(self) -> Dict[_K, Union[_V, List[_V]]]: ...
46+
def dict(self) -> Dict[_K, _V]: ...
4747
def copy(self: _D) -> _D: ...
4848
# These overrides are needed to convince mypy that this isn't an abstract class
4949
def __delitem__(self, item: _K) -> None: ...

0 commit comments

Comments
 (0)