On 8/28/06, tobiah <[EMAIL PROTECTED]> wrote: > def foo(thing): > > if thing: > return thing + 1 > else: > return -1 > > def foo(thing): > > if thing: > return thing + 1 > return -1 > > Obviously both do the same thing. The first is > possibly clearer, while the second is more concise. > > Comments? if there is nothing the else will check why put it there? > > -- > Posted via a free Usenet account from http://www.teranews.com > > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list
- Coding style and else statements tobiah
- Re: Coding style and else statements Jorge Vargas
- Re: Coding style and else statements Bruno Desthuilliers
- Re: Coding style and else statements Sam Pointon
- Re: Coding style and else statements Bruno Desthuilliers
- Re: Coding style and else statements Tal Einat
- Re: Coding style and else statem... Tal Einat
- Re: Coding style and else st... Gabriel Genellina
- Re: Coding style and else st... [EMAIL PROTECTED]
- Re: Coding style and else statements Tal Einat
- Re: Coding style and else statements Carl Banks
- Re: Coding style and else statements Steve Holden