fix itervalues

This commit is contained in:
Luke Campagnola 2018-05-15 16:37:58 -07:00
parent a86ab30578
commit 1f380c93c1
3 changed files with 7 additions and 7 deletions

View File

@ -222,7 +222,7 @@ class Node(QtCore.QObject):
for t in self.inputs().values():
nodes |= set([i.node() for i in t.inputTerminals()])
return nodes
#return set([t.inputTerminals().node() for t in self.listInputs().itervalues()])
#return set([t.inputTerminals().node() for t in self.listInputs().values()])
def __repr__(self):
return "<Node %s @%x>" % (self.name(), id(self))
@ -477,7 +477,7 @@ class NodeGraphicsItem(GraphicsObject):
#self.node.sigTerminalRenamed.connect(self.updateActionMenu)
#def setZValue(self, z):
#for t, item in self.terminals.itervalues():
#for t, item in self.terminals.values():
#item.setZValue(z+1)
#GraphicsObject.setZValue(self, z)

View File

@ -311,7 +311,7 @@ class ProtectedDict(dict):
raise Exception("It is not safe to copy protected dicts! (instead try deepcopy, but be careful.)")
def itervalues(self):
for v in self._data_.itervalues():
for v in self._data_.values():
yield protect(v)
def iteritems(self):

View File

@ -94,14 +94,14 @@ class LRUCache(object):
else:
def values(self):
return [i[1] for i in self._dict.itervalues()]
return [i[1] for i in self._dict.values()]
def keys(self):
return [x[0] for x in self._dict.itervalues()]
return [x[0] for x in self._dict.values()]
def _resizeTo(self):
ordered = sorted(self._dict.itervalues(), key=operator.itemgetter(2))[:self.resizeTo]
ordered = sorted(self._dict.values(), key=operator.itemgetter(2))[:self.resizeTo]
for i in ordered:
del self._dict[i[0]]
@ -114,7 +114,7 @@ class LRUCache(object):
============= ======================================================
'''
if accessTime:
for x in sorted(self._dict.itervalues(), key=operator.itemgetter(2)):
for x in sorted(self._dict.values(), key=operator.itemgetter(2)):
yield x[0], x[1]
else:
for x in self._dict.items():