##// END OF EJS Templates
Use lambda instead of operator.itemgetter
Thomas Kluyver -
Show More
@@ -42,7 +42,6 b' somewhere in your configuration files or ipython command line.'
42 #*****************************************************************************
42 #*****************************************************************************
43
43
44 import os
44 import os
45 import operator
46 import subprocess
45 import subprocess
47 import sys
46 import sys
48
47
@@ -148,7 +147,7 b' class CommandChainDispatcher:'
148 def add(self, func, priority=0):
147 def add(self, func, priority=0):
149 """ Add a func to the cmd chain with given priority """
148 """ Add a func to the cmd chain with given priority """
150 self.chain.append((priority, func))
149 self.chain.append((priority, func))
151 self.chain.sort(key=operator.itemgetter(0))
150 self.chain.sort(key=lambda x: x[0])
152
151
153 def __iter__(self):
152 def __iter__(self):
154 """ Return all objects in chain.
153 """ Return all objects in chain.
General Comments 0
You need to be logged in to leave comments. Login now