[PATCH 1 of 2] sortdict: add iteritems method

Martin von Zweigbergk martinvonz at google.com
Thu Nov 6 23:27:37 CST 2014


Why? For use in an extension or future patch? Or does this fix something?

On Thu Nov 06 2014 at 3:10:18 PM Sean Farley <sean.michael.farley at gmail.com>
wrote:

> # HG changeset patch
> # User Sean Farley <sean.michael.farley at gmail.com>
> # Date 1413475012 25200
> #      Thu Oct 16 08:56:52 2014 -0700
> # Node ID 45fd23c47bb429c84e28a3303fb2a1097c5082e2
> # Parent  2d54aa5397cdb1c697673ba10b7618d5ac25c69e
> sortdict: add iteritems method
>
> Nothing really fancy, just adding this method to make sure when iteritems
> is
> used that it is iterated in correct order.
>
> diff --git a/mercurial/util.py b/mercurial/util.py
> --- a/mercurial/util.py
> +++ b/mercurial/util.py
> @@ -367,10 +367,12 @@ class sortdict(dict):
>              pass
>      def keys(self):
>          return self._list
>      def iterkeys(self):
>          return self._list.__iter__()
> +    def iteritems(self):
> +        return self.items().__iter__()
>
>  class lrucachedict(object):
>      '''cache most recent gets from or sets to this dictionary'''
>      def __init__(self, maxsize):
>          self._cache = {}
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20141107/a4820c56/attachment.html>


More information about the Mercurial-devel mailing list