[PATCH] check-code: permit functools.reduce
Yedidya Feldblum
yfeldblum at fb.com
Mon Feb 6 22:22:38 UTC 2017
# HG changeset patch
# User Yedidya Feldblum <yfeldblum at fb.com>
# Date 1485038593 28800
# Sat Jan 21 14:43:13 2017 -0800
# Node ID 47d8e895ccb734f0219dd046795b042da002b06b
# Parent 036c37bd3ec189480647ff568cee9e0b43a5bc81
check-code: permit functools.reduce
diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -237,7 +237,7 @@
(r'lambda\s*\(.*,.*\)',
"tuple parameter unpacking not available in Python 3+"),
(r'(?<!def)\s+(cmp)\(', "cmp is not available in Python 3+"),
- (r'\breduce\s*\(.*', "reduce is not available in Python 3+"),
+ (r'(?<!\.)\breduce\s*\(.*', "reduce is not available in Python 3+"),
(r'\bdict\(.*=', 'dict() is different in Py2 and 3 and is slower than {}',
'dict-from-generator'),
(r'\.has_key\b', "dict.has_key is not available in Python 3+"),
More information about the Mercurial-devel
mailing list