Mercurial > hg-stable
changeset 23260:565f97e71ce3
sortdict: add iteritems method
Future patches will start using sortdict for log operations where order is
important. Adding iteritems removes the headache of having to remember to use
items() if the object is a sortdict.
author | Sean Farley <sean.michael.farley@gmail.com> |
---|---|
date | Sun, 09 Nov 2014 13:15:28 -0800 |
parents | 9f4778027bc2 |
children | 79858e66a7ce |
files | mercurial/util.py |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/util.py Sat Nov 08 23:13:39 2014 -0800 +++ b/mercurial/util.py Sun Nov 09 13:15:28 2014 -0800 @@ -369,6 +369,9 @@ return self._list def iterkeys(self): return self._list.__iter__() + def iteritems(self): + for k in self._list: + yield k, self[k] class lrucachedict(object): '''cache most recent gets from or sets to this dictionary'''