Duncan Booth wrote: > Reinhold Birkenfeld wrote: > >> Hi, >> >> while writing my solution for "The python way?", I came across this >> fragment: >> >> vees = [c for c in wlist[::-1] if c in vocals] >> cons = [c for c in wlist[::-1] if c not in vocals] >> >> So I think: Have I overlooked a function which splits up a sequence >> into two, based on a condition? Such as >> >> vees, cons = split(wlist[::-1], lambda c: c in vocals) >> >> Reinhold > > If you really are being charged by the number of newline characters in your > code you could write:
[...] > but every penny you save writing a one liner will be tuppence extra on > maintenance. This is clear. I actually wanted to know if there is a function which I overlooked which does that, which wouldn't be a maintenance nightmare at all. Reinhold -- http://mail.python.org/mailman/listinfo/python-list