mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
[1.1.X] Fixed #12476 -- Forced the rollout of generators passed to SortedDict so that the data source can be read twice. Thanks to gsf for the report, and Alex for the patch.
Backport of r12064 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12065 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -60,9 +60,9 @@ MultiValueDictKeyError: "Key 'lastname' not found in <MultiValueDict: {'position
|
||||
>>> d.setlist('lastname', ['Holovaty', 'Willison'])
|
||||
>>> d.getlist('lastname')
|
||||
['Holovaty', 'Willison']
|
||||
>>> d.values()
|
||||
>>> d.values()
|
||||
['Developer', 'Simon', 'Willison']
|
||||
>>> list(d.itervalues())
|
||||
>>> list(d.itervalues())
|
||||
['Developer', 'Simon', 'Willison']
|
||||
|
||||
### SortedDict #################################################################
|
||||
@@ -95,6 +95,9 @@ True
|
||||
>>> d.pop('one', 'missing')
|
||||
'missing'
|
||||
|
||||
>>> SortedDict((i, i) for i in xrange(3))
|
||||
{0: 0, 1: 1, 2: 2}
|
||||
|
||||
We don't know which item will be popped in popitem(), so we'll just check that
|
||||
the number of keys has decreased.
|
||||
>>> l = len(d)
|
||||
|
||||
Reference in New Issue
Block a user