Patchwork [1,of,4] pycompat: name maplist() and ziplist() for better traceback message

login
register
mail settings
Submitter Yuya Nishihara
Date March 13, 2018, 1:55 p.m.
Message ID <aa35c6d7caef9ef9f48d.1520949309@mimosa>
Download mbox | patch
Permalink /patch/29436/
State Accepted
Headers show

Comments

Yuya Nishihara - March 13, 2018, 1:55 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1520943734 -32400
#      Tue Mar 13 21:22:14 2018 +0900
# Node ID aa35c6d7caef9ef9f48d0c9c831f9492c1421c45
# Parent  6aeb076b1321c540db6419fc48c8a3a552fb596b
pycompat: name maplist() and ziplist() for better traceback message
Pulkit Goyal - March 13, 2018, 3:25 p.m.
On Tue, Mar 13, 2018 at 7:25 PM, Yuya Nishihara <yuya@tcha.org> wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1520943734 -32400
> #      Tue Mar 13 21:22:14 2018 +0900
> # Node ID aa35c6d7caef9ef9f48d0c9c831f9492c1421c45
> # Parent  6aeb076b1321c540db6419fc48c8a3a552fb596b
> pycompat: name maplist() and ziplist() for better traceback message

Queued the first two patches. Many thanks!

Patch

diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py
--- a/mercurial/pycompat.py
+++ b/mercurial/pycompat.py
@@ -65,8 +65,13 @@  if ispy3:
     if sysexecutable:
         sysexecutable = os.fsencode(sysexecutable)
     stringio = io.BytesIO
-    maplist = lambda *args: list(map(*args))
-    ziplist = lambda *args: list(zip(*args))
+
+    def maplist(*args):
+        return list(map(*args))
+
+    def ziplist(*args):
+        return list(zip(*args))
+
     rawinput = input
     getargspec = inspect.getfullargspec