mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-10 12:59:22 +01:00
Added partition to facilitate bugfix in irclib.Irc.removeCallback.
This commit is contained in:
parent
7e1eb72849
commit
e1dfcbd390
10
src/fix.py
10
src/fix.py
@ -339,4 +339,14 @@ def flatten(seq, strings=False):
|
||||
except TypeError:
|
||||
yield elt
|
||||
|
||||
def partition(p, L):
|
||||
no = []
|
||||
yes = []
|
||||
for elt in L:
|
||||
if p(elt):
|
||||
yes.append(elt)
|
||||
else:
|
||||
no.append(elt)
|
||||
return (yes, no)
|
||||
|
||||
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
||||
|
Loading…
Reference in New Issue
Block a user