[PATCH] check-code: permit functools.reduce

Augie Fackler raf at durin42.com
Tue Feb 7 00:23:09 EST 2017


> On Feb 6, 2017, at 17:22, Yedidya Feldblum <yfeldblum at fb.com> wrote:
> 
> # 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

Sure, queued.


> 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+"),
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel



More information about the Mercurial-devel mailing list