Patchwork [1,of,8] check-code: drop ban on callable() which was restored in Python 3.2

login
register
mail settings
Submitter Augie Fackler
Date June 24, 2014, 6:37 p.m.
Message ID <f8c50a5f41dab292b810.1403635057@augie-macbookair>
Download mbox | patch
Permalink /patch/5054/
State Accepted
Commit fb16f6da5b3bf7e6fdbfe6bbe82298d7a67f7f44
Headers show

Comments

Augie Fackler - June 24, 2014, 6:37 p.m.
# HG changeset patch
# User Augie Fackler <raf@durin42.com>
# Date 1403529773 14400
#      Mon Jun 23 09:22:53 2014 -0400
# Node ID f8c50a5f41dab292b81069fa3a898b070fd5b7fd
# Parent  15baed3f24ee98a7aaecfaf9b8c93e3695c9a813
check-code: drop ban on callable() which was restored in Python 3.2

A followup will restore use of callable() in place of the awkward
hasattr() construction we were using to be one step closer to Python
3.

Patch

diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -247,8 +247,6 @@ 
     (r'^\s*os\.path\.relpath', "relpath not available in Python 2.4"),
     (r'(?<!def)\s+(any|all|format)\(',
      "any/all/format not available in Python 2.4", 'no-py24'),
-    (r'(?<!def)\s+(callable)\(',
-     "callable not available in Python 3, use getattr(f, '__call__', None)"),
     (r'if\s.*\selse', "if ... else form not available in Python 2.4"),
     (r'^\s*(%s)\s\s' % '|'.join(keyword.kwlist),
      "gratuitous whitespace after Python keyword"),