[PATCH 8 of 9] check-code: added a check for tuple parameter unpacking (unsupported in py3k)

Renato Cunha renatoc at gmail.com
Wed Jul 14 21:18:41 CDT 2010


# HG changeset patch
# User Renato Cunha <renatoc at gmail.com>
# Date 1279160100 10800
# Branch stable
# Node ID 1d847cdaba116394131b87e060907ceb1211c81f
# Parent  1c3a075e500905c8d9ffeddd92bb6fd00b7c3ae5
check-code: added a check for tuple parameter unpacking (unsupported in py3k)

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -70,6 +70,10 @@
 ]
 
 pypats = [
+    (r'^\s*def\s*\w+\s*\(.*,\s*\(',
+     "tuple parameter unpacking not available in Python 3+"),
+    (r'lambda\s*\(.*,.*\)',
+     "tuple parameter unpacking not available in Python 3+"),
     (r'^\s*\t', "don't use tabs"),
     (r'\S;\s*\n', "semicolon"),
     (r'\w,\w', "missing whitespace after ,"),


More information about the Mercurial-devel mailing list