Looking for the best way to translate an idiom

Steve Holden steve at holdenweb.com
Sun Dec 14 19:00:07 CET 2008


Bruno Desthuilliers wrote:
[...]
> if you only want the first returned value, you can just apply a slice:
> 
> def f():
>    return 1,2,3
> 
> a = f()[0] + 1
> 
<nit>That isn't a slice, it's indexing</nit>

regards
 Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/




More information about the Python-list mailing list