From 8ab7ce8558792f41637d6f87f2a8a117e169dd18 Mon Sep 17 00:00:00 2001 From: Daniel F Moisset Date: Fri, 7 Apr 2017 10:30:49 +0200 Subject: [PATCH] Fixed #28037 -- Clarified that QueryDict.items()/values() are generators. --- docs/ref/request-response.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt index 16e5fd90bf..52a9e577e6 100644 --- a/docs/ref/request-response.txt +++ b/docs/ref/request-response.txt @@ -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: