I assume that `.pop()` should be the same as `.get()`, but the key should
get deleted afterward.
Here's an example:
{{{
In [1]: from django.utils.datastructures import MultiValueDict
In [2]: data = MultiValueDict({"name": ["Yaroslav", "Clara"], "age": [22,
32]})
In [3]: data.get("name")
Out[3]: 'Clara'
In [4]: data.pop("name")
Out[4]: ['Yaroslav', 'Clara']
}}}
As you can see, we've got a single item for `.get()`, and a list for
`.pop()`, which is confusing.
We should have all of that synced. `.get()` with `.getlist()`, and
`.pop()` with `.poplist()`.
Here's how it looks like after I've done some changes:
{{{
In [4]: data.pop("name")
Out[4]: 'Clara'
}}}
{{{
In [5]: data.poplist("name")
Out[5]: ['Yaroslav', 'Clara']
}}}
This is breaking change probably.
--
Ticket URL: <https://code.djangoproject.com/ticket/33204>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: Yaroslav Pankovych (added)
* needs_docs: 0 => 1
Comment:
https://github.com/django/django/pull/14945
--
Ticket URL: <https://code.djangoproject.com/ticket/33204#comment:1>
* status: new => closed
* resolution: => wontfix
* component: Core (Other) => HTTP handling
Comment:
Thanks for the suggestion, however I don't think it's worth breaking
backwards compatibility. We need to reach a strong consensus on the
DevelopersMailingList before moving it forward. Please
[https://docs.djangoproject.com/en/stable/internals/contributing/triaging-
tickets/#closing-tickets follow the triaging guidelines with regards to
wontfix tickets] and take this to DevelopersMailingList.
--
Ticket URL: <https://code.djangoproject.com/ticket/33204#comment:2>