# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1512951995 -19800 # Node ID e66d6e938d2d2909ef37bd92b3eb21d3c8173e29 # Parent 6ebe899b6551bc0dbe1d2a8c80de6f557c842e01 py3: introduce pycompat.ziplist as zip is a generator on Python 3 Similar to map, the return value of zip was also turned into a generator on Python 3. We have multiple occurences in our codebase where we retrieve the values of zip multiple times, so let's introduce pycompat.ziplist similar to pycompat.maplist. Differential Revision: https://phab.mercurial-scm.org/D1675 diff -r 6ebe899b6551 -r e66d6e938d2d mercurial/pycompat.py --- a/mercurial/pycompat.py Mon Dec 11 05:26:46 2017 +0530 +++ b/mercurial/pycompat.py Mon Dec 11 05:56:35 2017 +0530 @@ -63,6 +63,7 @@ sysexecutable = os.fsencode(sysexecutable) stringio = io.BytesIO maplist = lambda *args: list(map(*args)) + ziplist = lambda *args: list(zip(*args)) rawinput = input # TODO: .buffer might not exist if std streams were replaced; we'll need @@ -313,6 +314,7 @@ shlexsplit = shlex.split stringio = cStringIO.StringIO maplist = map + ziplist = zip rawinput = raw_input isjython = sysplatform.startswith('java')