summaryrefslogtreecommitdiff
path: root/numpy/_import_tools.py
diff options
context:
space:
mode:
authorJarrod Millman <millman@berkeley.edu>2007-11-28 05:12:37 +0000
committerJarrod Millman <millman@berkeley.edu>2007-11-28 05:12:37 +0000
commit6c00b1141fdfa7d168a9b82e6ab493c77f7c1621 (patch)
tree0e9b0714a7d0a5e83ca3d321b4d9aca588347f4a /numpy/_import_tools.py
parent3fe715c0d0deb78ace46c3dbaf3165e8c4283e3c (diff)
downloadnumpy-6c00b1141fdfa7d168a9b82e6ab493c77f7c1621.tar.gz
use 'in' keyword to test dictionary membership
Diffstat (limited to 'numpy/_import_tools.py')
-rw-r--r--numpy/_import_tools.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/numpy/_import_tools.py b/numpy/_import_tools.py
index 3df55c26d..7940e84ff 100644
--- a/numpy/_import_tools.py
+++ b/numpy/_import_tools.py
@@ -21,7 +21,7 @@ class PackageLoader:
if isinstance(parent_path, str):
parent_path = [parent_path]
self.parent_path = parent_path
- if not frame.f_locals.has_key('__all__'):
+ if '__all__' not in frame.f_locals:
exec('__all__ = []',frame.f_globals,frame.f_locals)
self.parent_export_names = eval('__all__',frame.f_globals,frame.f_locals)
@@ -77,7 +77,7 @@ class PackageLoader:
% (package_name,':'.join(self.parent_path), msg))
for package_name,info_file in info_files:
- if info_modules.has_key(package_name):
+ if package_name in info_modules:
continue
fullname = self.parent_name +'.'+ package_name
if info_file[-1]=='c':
@@ -119,7 +119,7 @@ class PackageLoader:
while depend_dict:
for name, lst in depend_dict.items():
- new_lst = [n for n in lst if depend_dict.has_key(n)]
+ new_lst = [n for n in lst if n in depend_dict]
if not new_lst:
package_names.append(name)
del depend_dict[name]
@@ -225,7 +225,7 @@ class PackageLoader:
if verbose!=-1:
old_objects = {}
for s in symbols:
- if frame.f_locals.has_key(s):
+ if s in frame.f_locals:
old_objects[s] = frame.f_locals[s]
cmdstr = 'from '+package_name+' import '+symbol
@@ -325,7 +325,7 @@ class PackageLoader:
global_symbols = getattr(info_module,'global_symbols',[])
fullname = self.parent_name +'.'+ package_name
note = ''
- if not sys.modules.has_key(fullname):
+ if fullname not in sys.modules:
note = ' [*]'
titles.append((fullname,self._get_doc_title(info_module) + note))
if global_symbols: