Split a list into two parts based on a filter?

rusi rustompmody at gmail.com
Tue Jun 11 13:23:52 EDT 2013


On Jun 11, 10:05 pm, Fábio Santos <fabiosantos... at gmail.com> wrote:
> On 11 Jun 2013 17:47, "rusi" <rustompm... at gmail.com> wrote:
>
> > [Of course I would prefer a 3-liner where the body of the for is
> > indented :-) ]
>
> Is this an aside comprehension?

Eh?

Its a for-loop. Same as:
for s in songs:
   (new_songs if s.is_new() else old_songs).append(s)

Maybe you are unfamiliar with the line
... A suite can be one or more semicolon-separated simple statements
on the same line as the header,
??

from http://docs.python.org/2/reference/compound_stmts.html

Or you are joking??

What with the offside rule (indentation rule in Haskell) becoming the
'aside rule' causing (in)comprehension in reading comprehensions??

Ok... Jokes aside... Dunno what you are asking.



More information about the Python-list mailing list