From a8a4130112978b40858b2e116d13bf300f0f4c5b 2012-06-12 22:35:56 From: Thomas Kluyver Date: 2012-06-12 22:35:56 Subject: [PATCH] Use lambda instead of operator.itemgetter --- diff --git a/IPython/core/hooks.py b/IPython/core/hooks.py index 7e01e05..d47e11e 100644 --- a/IPython/core/hooks.py +++ b/IPython/core/hooks.py @@ -42,7 +42,6 @@ somewhere in your configuration files or ipython command line. #***************************************************************************** import os -import operator import subprocess import sys @@ -148,7 +147,7 @@ class CommandChainDispatcher: def add(self, func, priority=0): """ Add a func to the cmd chain with given priority """ self.chain.append((priority, func)) - self.chain.sort(key=operator.itemgetter(0)) + self.chain.sort(key=lambda x: x[0]) def __iter__(self): """ Return all objects in chain.