From d3d43f8a0c31fb4a72c813e228a09588d38b5d74 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 20 Apr 2004 10:11:27 +0000 Subject: [PATCH] Various sorted updates (pun intended, punks :)) --- src/Channel.py | 6 ++---- src/fix.py | 8 -------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/Channel.py b/src/Channel.py index e86953a29..5f9351dd2 100755 --- a/src/Channel.py +++ b/src/Channel.py @@ -435,8 +435,7 @@ class Channel(callbacks.Privmsg): s = 'I\'m not currently ignoring any hostmasks in %r' % channel irc.reply(s) else: - L = c.ignores[:] - L.sort() + L = sorted(c.ignores) irc.reply(utils.commaAndify(imap(repr, L))) ignores = privmsgs.checkChannelCapability(ignores, 'op') @@ -542,8 +541,7 @@ class Channel(callbacks.Privmsg): """ channel = privmsgs.getChannel(msg, args) c = ircdb.channels.getChannel(channel) - L = list(c.capabilities) - L.sort() + L = sorted(c.capabilities) irc.reply('[%s]' % '; '.join(L)) def lobotomies(self, irc, msg, args): diff --git a/src/fix.py b/src/fix.py index 3066fdcc7..409bb2ddb 100644 --- a/src/fix.py +++ b/src/fix.py @@ -168,14 +168,6 @@ def rsplit(s, sep=None, maxsplit=-1): L.reverse() return [s[::-1] for s in L] -def sorted(iterable, cmp=None, key=None, reverse=False): - L = list(iterable) -## if key is None: -## L.sort(cmp) -## else: -## # Oops, we don't have sortBy. Let's come back to this.utils. -## utils.sortBy(key - import operator def itemgetter(i): return lambda x: x[i]