changeset 11522:eaa7666ad53f stable

check-code: add test for callable
author Martin Geisler <mg@aragost.com>
date Fri, 09 Jul 2010 14:01:55 +0200
parents 3efadce5b346
children dec57aa0f8ca
files contrib/check-code.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 ="),