Why does list have no 'get' method?

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Thu Feb 7 16:25:43 EST 2008


On Thu, 07 Feb 2008 15:59:13 +0100, Wildemar Wildenburger wrote:

> Arnaud Delobelle wrote:
>> Personally, between
>> 
>> * foo if foo else bar
>> * foo or bar
>> 
>> I prefer the second. Maybe it could be spelt
>> 
>> * foo else bar ?
>> 
> How about
> 
> val = foo rather than bar
> 
> If that is not clear and obvios, I don't know what is.  ;)

In English, the expression "foo rather than bar" means "bar is never 
chosen, foo is always chosen".

Oh, and if you think it's hard convincing Guido to add one new keyword, 
wait until you try to get him to add TWO.


-- 
Steven



More information about the Python-list mailing list