The "or" operator is what they call a "short circuiting" operator. If 
the first part is True then the second part is never evaluated. If the 
first part is False, then the second part is returned.

---
James

On Wed, Jan 28, 2009 at 04:03:27PM -0800, Yanom Mobis wrote:
>    how do you use the or statement in arguments?                  
>    i have never seen it done.                                     
>                                                                   
>    --- On Wed, 1/28/09, Ian Mallett <[email protected]> wrote: 
>                                                                   
>      From: Ian Mallett <[email protected]>                     
>      Subject: Re: [pygame] Name self not defined                  
>      To: [email protected]                                    
>      Date: Wednesday, January 28, 2009, 4:25 PM                   
>                                                                   
>      Frankly, I like this solution:                               
>      self.rect = self.rect.move(speedv or (0,0))                  
>      Looks Pythonic to me.                                        

Reply via email to