summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarrod Millman <millman@berkeley.edu>2007-10-29 09:09:59 +0000
committerJarrod Millman <millman@berkeley.edu>2007-10-29 09:09:59 +0000
commit3cb37bbdb4bdf773b7bc0098b8d0cf940288a883 (patch)
tree6baee7110d71e96ea928ea44c1fe7bc1a49a4439
parentdea664f86f0f24f0f999945e20f9b2042d6b159c (diff)
downloadnumpy-3cb37bbdb4bdf773b7bc0098b8d0cf940288a883.tar.gz
Using the in operator to find substrings. It is shorter and easier to understand.
-rw-r--r--numpy/distutils/ccompiler.py2
-rw-r--r--numpy/distutils/core.py2
-rwxr-xr-xnumpy/f2py/crackfortran.py4
-rwxr-xr-xnumpy/f2py/f2py2e.py2
-rwxr-xr-xnumpy/linalg/lapack_lite/make_lite.py2
5 files changed, 6 insertions, 6 deletions
diff --git a/numpy/distutils/ccompiler.py b/numpy/distutils/ccompiler.py
index 7999d1c82..4ba867b65 100644
--- a/numpy/distutils/ccompiler.py
+++ b/numpy/distutils/ccompiler.py
@@ -207,7 +207,7 @@ def CCompiler_customize(self, dist, need_cxx=0):
except (AttributeError, ValueError):
pass
- if hasattr(self,'compiler') and self.compiler[0].find('cc')>=0:
+ if hasattr(self,'compiler') and 'cc' in self.compiler[0]:
if not self.compiler_cxx:
if self.compiler[0].startswith('gcc'):
a, b = 'gcc', 'g++'
diff --git a/numpy/distutils/core.py b/numpy/distutils/core.py
index 5ae6353f2..5e2ab408b 100644
--- a/numpy/distutils/core.py
+++ b/numpy/distutils/core.py
@@ -92,7 +92,7 @@ def get_distribution(always=False):
# We can't use isinstance, as the DistributionWithoutHelpCommands
# class is local to a function in setuptools.command.easy_install
if dist is not None and \
- repr(dist).find('DistributionWithoutHelpCommands') != -1:
+ 'DistributionWithoutHelpCommands' in repr(dist):
dist = None
if always and dist is None:
dist = distutils.dist.Distribution()
diff --git a/numpy/f2py/crackfortran.py b/numpy/f2py/crackfortran.py
index 7026cd01a..fd479203b 100755
--- a/numpy/f2py/crackfortran.py
+++ b/numpy/f2py/crackfortran.py
@@ -1494,7 +1494,7 @@ def postcrack(block,args=None,tab=''):
for g in block:
setmesstext(g)
g=postcrack(g,tab=tab+'\t')
- if g.has_key('name') and string.find(g['name'],'__user__')>=0: # sort user routines to appear first
+ if g.has_key('name') and '__user__' in g['name']: # sort user routines to appear first
uret.append(g)
else:
gret.append(g)
@@ -1518,7 +1518,7 @@ def postcrack(block,args=None,tab=''):
if block.has_key('use'):
useblock=block['use']
for k in useblock.keys():
- if string.find(k,'__user__')>=0:
+ if '__user__' in k:
userisdefined.append(k)
## if useblock[k].has_key('map'):
## for n in useblock[k]['map'].values():
diff --git a/numpy/f2py/f2py2e.py b/numpy/f2py/f2py2e.py
index d86327faa..b4aa7bf32 100755
--- a/numpy/f2py/f2py2e.py
+++ b/numpy/f2py/f2py2e.py
@@ -289,7 +289,7 @@ def buildmodules(list):
outmess('Building modules...\n')
modules,mnames,isusedby=[],[],{}
for i in range(len(list)):
- if string.find(list[i]['name'],'__user__')>=0:
+ if '__user__' in list[i]['name']:
cb_rules.buildcallbacks(list[i])
else:
if list[i].has_key('use'):
diff --git a/numpy/linalg/lapack_lite/make_lite.py b/numpy/linalg/lapack_lite/make_lite.py
index dec0be017..ebd450023 100755
--- a/numpy/linalg/lapack_lite/make_lite.py
+++ b/numpy/linalg/lapack_lite/make_lite.py
@@ -141,7 +141,7 @@ class FortranLibrary:
class LapackLibrary(FortranLibrary):
def _newFortranRoutine(self, rname, filename):
routine = FortranLibrary._newFortranRoutine(self, rname, filename)
- if filename.find('BLAS') != -1:
+ if 'BLAS' in filename
routine.type = 'blas'
elif rname.startswith('z'):
routine.type = 'zlapack'