Re: first of not None

2008-10-09 Thread Serge Matveenko
On 10/9/08, Serge Matveenko [EMAIL PROTECTED] wrote: I need to put in the var property of the first object from the list that is not None. Somth like: foo = first_of([any, beny, riki,]).name Dont want to ugly if-cascade: foo = any.name if name is not None else beny.name if beny is not None

Re: first of not None

2008-10-09 Thread Diez B. Roggisch
Serge Matveenko schrieb: On 10/9/08, Serge Matveenko [EMAIL PROTECTED] wrote: I need to put in the var property of the first object from the list that is not None. Somth like: foo = first_of([any, beny, riki,]).name Dont want to ugly if-cascade: foo = any.name if name is not None else

first of not None

2008-10-09 Thread Serge Matveenko
Hello, everybody! Could someone help me with coding this thing? I need to put in the var property of the first object from the list that is not None. Somth like: foo = first_of([any, beny, riki,]).name Dont want to ugly if-cascade: foo = any.name if name is not None else beny.name if beny is

Re: first of not None

2008-10-09 Thread Bruno Desthuilliers
Serge Matveenko a écrit : Hello, everybody! Could someone help me with coding this thing? I need to put in the var property of the first object from the list that is not None. Somth like: foo = first_of([any, beny, riki,]).name Dont want to ugly if-cascade: foo = any.name if name is not

Re: first of not None

2008-10-09 Thread Tim Chase
I need to put in the var property of the first object from the list that is not None. Somth like: foo = first_of([any, beny, riki,]).name Dont want to ugly if-cascade: foo = any.name if name is not None else beny.name if beny is not None \ else riki.name if riki is not None assuming you