check-code: add test for callable stable
authorMartin Geisler <mg@aragost.com>
Fri, 09 Jul 2010 14:01:55 +0200
branchstable
changeset 11522 eaa7666ad53f
parent 11521 3efadce5b346
child 11523 dec57aa0f8ca
check-code: add test for callable
contrib/check-code.py
--- a/contrib/check-code.py	Fri Jul 09 11:04:00 2010 +0200
+++ b/contrib/check-code.py	Fri Jul 09 14:01:55 2010 +0200
@@ -94,6 +94,8 @@
     (r'^\s*with\s+', "with not available in Python 2.4"),
     (r'(?<!def)\s+(any|all|format)\(',
      "any/all/format not available in Python 2.4"),
+    (r'(?<!def)\s+(callable)\(',
+     "callable not available in Python 3, use hasattr(f, '__call__')"),
     (r'if\s.*\selse', "if ... else form not available in Python 2.4"),
     (r'([\(\[]\s\S)|(\S\s[\)\]])', "gratuitous whitespace in () or []"),
 #    (r'\s\s=', "gratuitous whitespace before ="),