[PATCH] D67819: [LNT] Python 3 support: adapt to zip returning a view

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 23 05:48:05 PDT 2019


thopre updated this revision to Diff 221310.
thopre added a comment.

Add comments to pairs() stating it returns an iterable.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67819/new/

https://reviews.llvm.org/D67819

Files:
  lnt/server/reporting/report.py


Index: lnt/server/reporting/report.py
===================================================================
--- lnt/server/reporting/report.py
+++ lnt/server/reporting/report.py
@@ -8,8 +8,9 @@
 
 OrderAndHistory = namedtuple('OrderAndHistory', ['max_order', 'recent_orders'])
 
-def pairs(list):
-    return zip(list[:-1], list[1:])
+def pairs(l):
+    """Make an iterable of all pairs of consecutive elements in l."""
+    return zip(l[:-1], l[1:])
 
 # The hash color palette avoids green and red as these colours are already used
 # in quite a few places to indicate "good" or "bad".


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67819.221310.patch
Type: text/x-patch
Size: 586 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190923/b59140f0/attachment.bin>


More information about the llvm-commits mailing list