Why does list have no 'get' method?

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Fri Feb 8 00:28:16 CET 2008


En Thu, 07 Feb 2008 19:36:57 -0200, George Sakkis  
<george.sakkis at gmail.com> escribió:

> On Feb 7, 4:25 pm, Steven D'Aprano <st... at REMOVE-THIS-
> cybersource.com.au> wrote:
>> On Thu, 07 Feb 2008 15:59:13 +0100, Wildemar Wildenburger wrote:
>>
>> > 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".
>
> Ok, the fix is easy:
>
> val = BETTER foo THAN bar

Great! It could even be qualified:

     val = BETTER foo THAN bar UNLESS not required(foo)

and nested:

     val = BETTER foo THAN (
                  BETTER bar THAN baz
                      UNLESS lunar_phase=="Full Moon")

and used wherever any other expression is allowed:

     val = BETTER foo THAN (
                  BETTER bar THAN baz
                      UNLESS insanity_level>threshold)
                  UNLESS self.parent is self \
               if verbose else 42

Sane precedence rules would require using ( ) around the expression before  
the if clause, I presume.

Eagerly awaiting the implementation,
-- 
Gabriel Genellina




More information about the Python-list mailing list