diff --git a/pyqtgraph/debug.py b/pyqtgraph/debug.py index 15d1fb3c..37b612cd 100644 --- a/pyqtgraph/debug.py +++ b/pyqtgraph/debug.py @@ -202,7 +202,7 @@ def findRefPath(startObj, endObj, maxLen=8, restart=True, seen={}, path=None, ig #print prefix+" FRAME" continue try: - if any([r is x for x in path]): + if any(r is x for x in path): #print prefix+" LOOP", objChainString([r]+path) continue except: @@ -282,7 +282,7 @@ def refPathString(chain): o2 = chain[i] cont = False if isinstance(o1, list) or isinstance(o1, tuple): - if any([o2 is x for x in o1]): + if any(o2 is x for x in o1): s += "[%d]" % o1.index(o2) continue #print " not list" diff --git a/pyqtgraph/dockarea/Container.py b/pyqtgraph/dockarea/Container.py index 04b775f9..34f16288 100644 --- a/pyqtgraph/dockarea/Container.py +++ b/pyqtgraph/dockarea/Container.py @@ -126,7 +126,7 @@ class SplitContainer(Container, QtGui.QSplitter): def saveState(self): sizes = self.sizes() - if all([x == 0 for x in sizes]): + if all(x == 0 for x in sizes): sizes = [10] * len(sizes) return {'sizes': sizes} diff --git a/pyqtgraph/imageview/ImageView.py b/pyqtgraph/imageview/ImageView.py index c7f0b66d..6f60170c 100644 --- a/pyqtgraph/imageview/ImageView.py +++ b/pyqtgraph/imageview/ImageView.py @@ -274,7 +274,7 @@ class ImageView(QtGui.QWidget): if not isinstance(img, np.ndarray): required = ['dtype', 'max', 'min', 'ndim', 'shape', 'size'] - if not all([hasattr(img, attr) for attr in required]): + if not all(hasattr(img, attr) for attr in required): raise TypeError("Image must be NumPy array or any object " "that provides compatible attributes/methods:\n" " %s" % str(required)) diff --git a/pyqtgraph/metaarray/MetaArray.py b/pyqtgraph/metaarray/MetaArray.py index 169ff43c..b07f66ab 100644 --- a/pyqtgraph/metaarray/MetaArray.py +++ b/pyqtgraph/metaarray/MetaArray.py @@ -124,7 +124,7 @@ class MetaArray(object): nameTypes = [basestring, tuple] @staticmethod def isNameType(var): - return any([isinstance(var, t) for t in MetaArray.nameTypes]) + return any(isinstance(var, t) for t in MetaArray.nameTypes) ## methods to wrap from embedded ndarray / HDF5