diff options
author | Jarrod Millman <millman@berkeley.edu> | 2007-11-28 05:12:37 +0000 |
---|---|---|
committer | Jarrod Millman <millman@berkeley.edu> | 2007-11-28 05:12:37 +0000 |
commit | 6c00b1141fdfa7d168a9b82e6ab493c77f7c1621 (patch) | |
tree | 0e9b0714a7d0a5e83ca3d321b4d9aca588347f4a /numpy/f2py/lib/parser/utils.py | |
parent | 3fe715c0d0deb78ace46c3dbaf3165e8c4283e3c (diff) | |
download | numpy-6c00b1141fdfa7d168a9b82e6ab493c77f7c1621.tar.gz |
use 'in' keyword to test dictionary membership
Diffstat (limited to 'numpy/f2py/lib/parser/utils.py')
-rw-r--r-- | numpy/f2py/lib/parser/utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/f2py/lib/parser/utils.py b/numpy/f2py/lib/parser/utils.py index ac2cfce8e..b27bf670f 100644 --- a/numpy/f2py/lib/parser/utils.py +++ b/numpy/f2py/lib/parser/utils.py @@ -113,7 +113,7 @@ def filter_stmts(content, classes): def get_module_files(directory, _cache={}): - if _cache.has_key(directory): + if directory in _cache: return _cache[directory] module_line = re.compile(r'(\A|^)module\s+(?P<name>\w+)\s*(!.*|)$',re.I | re.M) d = {} @@ -121,7 +121,7 @@ def get_module_files(directory, _cache={}): f = open(fn,'r') for name in module_line.findall(f.read()): name = name[1] - if d.has_key(name): + if name in d: print d[name],'already defines',name continue d[name] = fn |