From: Kurt B. Kaiser Date: Tue, 12 Feb 2008 21:34:12 +0000 (+0000) Subject: Convert some custom sort comparison functions to equivalent key functions. X-Git-Tag: v3.0a3~64 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4718bf894103887262287293599f4188e2601d37;p=thirdparty%2FPython%2Fcpython.git Convert some custom sort comparison functions to equivalent key functions. --- diff --git a/Lib/idlelib/configDialog.py b/Lib/idlelib/configDialog.py index e7a06909cb53..d0e4066b295c 100644 --- a/Lib/idlelib/configDialog.py +++ b/Lib/idlelib/configDialog.py @@ -980,16 +980,11 @@ class ConfigDialog(Toplevel): self.SetThemeType() ##load theme element option menu themeNames = list(self.themeElements.keys()) - themeNames.sort(self.__ThemeNameIndexCompare) + themeNames.sort(key=lambda x: self.themeElements[x][1]) self.optMenuHighlightTarget.SetMenu(themeNames,themeNames[0]) self.PaintThemeSample() self.SetHighlightTarget() - def __ThemeNameIndexCompare(self,a,b): - if self.themeElements[a][1] int(h2[2]): - return 1 - else: - return 0 - def GetAllExtraHelpSourcesList(self): """ Returns a list of tuples containing the details of all additional help