Ticket #10370: mvd_itervalues.diff
File mvd_itervalues.diff, 1.2 KB (added by , 16 years ago) |
---|
-
django/utils/datastructures.py
287 287 """Returns a list of the last value on every key list.""" 288 288 return [self[key] for key in self.keys()] 289 289 290 def itervalues(self): 291 """Yield the last value on every key list.""" 292 for list_ in super(MultiValueDict,self).itervalues(): 293 yield list_[-1] 294 290 295 def copy(self): 291 296 """Returns a copy of this object.""" 292 297 return self.__deepcopy__() -
tests/regressiontests/datastructures/tests.py
58 58 >>> d.setlist('lastname', ['Holovaty', 'Willison']) 59 59 >>> d.getlist('lastname') 60 60 ['Holovaty', 'Willison'] 61 >>> d.values() 62 ['Developer', 'Simon', 'Willison'] 63 >>> list(d.itervalues()) 64 ['Developer', 'Simon', 'Willison'] 61 65 62 66 ### SortedDict #################################################################