Improve MultiValueDict/QueryDict dict() return (#899)

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

3de787a70b/django/utils/datastructures.py (L215-L217)
This commit is contained in:
Marti Raudsepp
2022-03-31 11:47:45 +03:00
committed by GitHub
parent 212ef40c3d
commit 49d855547b

View File

@@ -43,7 +43,7 @@ class MultiValueDict(MutableMapping[_K, _V]):
def setlistdefault(self, key: _K, default_list: Optional[List[_V]] = ...) -> List[_V]: ...
def appendlist(self, key: _K, value: _V) -> None: ...
def lists(self) -> Iterable[Tuple[_K, List[_V]]]: ...
def dict(self) -> Dict[_K, Union[_V, List[_V]]]: ...
def dict(self) -> Dict[_K, _V]: ...
def copy(self: _D) -> _D: ...
# These overrides are needed to convince mypy that this isn't an abstract class
def __delitem__(self, item: _K) -> None: ...