[PATCH 1 of 3] check-code: make dict() pattern less invasive
Yuya Nishihara
yuya at tcha.org
Tue Aug 16 08:00:35 UTC 2016
# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1471249059 -32400
# Mon Aug 15 17:17:39 2016 +0900
# Node ID 9f9284385805b57572eb255ce35be3927ce0785b
# Parent 3747d3543f8b6d28709490b637197cfb0bc4ba64
check-code: make dict() pattern less invasive
'foodict(x=y)' should be allowed.
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 @@ pypats = [
"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'dict\(.*=', 'dict() is different in Py2 and 3 and is slower than {}',
+ (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+"),
(r'\s<>\s', '<> operator is not available in Python 3+, use !='),
More information about the Mercurial-devel
mailing list