Fixed #28037 -- Clarified that QueryDict.items()/values() are generators.

This commit is contained in:
Daniel F Moisset 2017-04-07 10:30:49 +02:00 committed by Tim Graham
parent 31e0b3b40b
commit 8ab7ce8558
1 changed files with 6 additions and 4 deletions

View File

@ -473,19 +473,21 @@ a subclass of dictionary. Exceptions are outlined here:
.. method:: QueryDict.items()
Like :meth:`dict.items`, except this uses the same last-value logic as
:meth:`__getitem__`. For example::
:meth:`__getitem__` and returns an iterator object instead of a view object.
For example::
>>> q = QueryDict('a=1&a=2&a=3')
>>> q.items()
>>> list(q.items())
[('a', '3')]
.. method:: QueryDict.values()
Like :meth:`dict.values`, except this uses the same last-value logic as
:meth:`__getitem__`. For example::
:meth:`__getitem__` and returns an iterator instead of a view object. For
example::
>>> q = QueryDict('a=1&a=2&a=3')
>>> q.values()
>>> list(q.values())
['3']
In addition, ``QueryDict`` has the following methods: