Inline Conditionals?

Alex Martelli aleaxit at yahoo.com
Thu Aug 26 17:08:59 EDT 2004


Robert Brewer <fumanchu at amor.org> wrote:
   ...
> > aux = []
> > for x in Somelist:
> >     if x.property:
> >         aux.append(foo(x))
> >     else
> >         aux.append(foo(x))
> > 
> > would be vastly more readable; "sparse is better than dense" 
> > and any LC
> > is far too dense to be Pythonic here.
> 
> Case in point: it makes it *vastly* easier to see the typo. What
> happened to bar()?

Closing hours...?


> But you planned that so someone else could deliver the punch line,
> didn't you? ;)

Ahem, yes, why, sure!


Alex



More information about the Python-list mailing list