check-code: permit functools.reduce
authorYedidya Feldblum <yfeldblum@fb.com>
Sat, 21 Jan 2017 14:43:13 -0800
changeset 30883 fe8ded72e17c
parent 30882 74cfc4357c64
child 30884 a68510b69f41
check-code: permit functools.reduce
contrib/check-code.py
--- a/contrib/check-code.py	Sat Feb 04 08:47:46 2017 -0800
+++ b/contrib/check-code.py	Sat Jan 21 14:43:13 2017 -0800
@@ -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+"),