Py3K idea: why not drop the colon?

Tony Nelson *firstname*nlsnews at georgea*lastname*.com
Fri Nov 10 17:30:00 CET 2006


In article <4rhku3FriokeU2 at mid.individual.net>,
 Bjoern Schliessmann <usenet-mail-0306.20.chr0n0ss at spamgourmet.com> 
 wrote:

> Michael Hobbs wrote:
> 
> > That is, assume that the expression ends at the colon, not at the
> > newline. That would make this type of statement possible:
> >     if color == red or
> >       color == blue or
> >       color == green:
> >         return 'primary'
> > Right now, such a statement would have to be spelled thus:
> >     if color == red or \
> >       color == blue or \
> >       color == green:
> >         return 'primary'
> > or
> >     if (color == red or
> >       color == blue or
> >       color == green):
> >         return 'primary'
> 
> What about
> 
> if color == red or blue or green:
>     return 'primary'

What about

    if color in [red, blue, green]:
        return 'primary'
________________________________________________________________________
TonyN.:'                        *firstname*nlsnews at georgea*lastname*.com
      '                                  <http://www.georgeanelson.com/>



More information about the Python-list mailing list