split

AndyC the WB spam at cunningham.me.uk
Fri Aug 9 12:16:54 EDT 2002


>>>>> "rzed" == rzed  <Dick.Zantow at lexisnexis.com> writes:

    rzed> "Seo Sanghyeon" <unendliche at hanmail.net> wrote in message
    rzed> news:45e6545c.0208082006.71908e01 at posting.google.com...
    >> How can I split a sequence other than a string?
    >> 
    >> >>> split([1,0,1,1,0,0,1,0], lambda x: x == 0) [[1], [1, 1],
    >> [1]]
    >> 
    >> ---- split=lambda q,p=lambda x:x==' ':[q[s+1:e] for s,e in
    >> zip(*[h+m+t
    rzed> for h,t in
    >> [([-1],[]),([],[l for l in [len(q)]])] for m in [[i for i in
    rzed> range(l) if p(q
    >> [i])]]]) if s+1!=e]

Perhaps the International Obfuscated C Code Contest should be replaced
with an International Impenetrable Python Contest.

-- 
AndyC the WB
Replace SPAM with Andy to reply



More information about the Python-list mailing list