Re: book example confusion

2008-09-13 Thread Fredrik Lundh
byron wrote: Being that each function is an object, a name assignment to (tmp1,tmp2) doesn't actually evaluate or run the function itself until the name is called.. the above would be true if the code had been tmp1, tmp2 = f1, f2 but it isn't. look again. -- http://mail.python.org/mai

Re: book example confusion

2008-09-12 Thread byron
On Sep 12, 3:51 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Sep 13, 5:36 am, byron <[EMAIL PROTECTED]> wrote: > > > > > I am reading o'reilly's learning python (great book), but i came > > across an example (pg 291, pdf) that I am not quite understanding the > > reasoning for the author's expla

Re: book example confusion

2008-09-12 Thread John Machin
On Sep 13, 5:36 am, byron <[EMAIL PROTECTED]> wrote: > I am reading o'reilly's learning python (great book), but i came > across an example (pg 291, pdf) that I am not quite understanding the > reasoning for the author's explanation: > > if f1() or f2(): > > The author states that do to the nature

Re: book example confusion

2008-09-12 Thread Chris Rebert
Note the parentheses after f1 and f2 in the second example. That's what calls the functions and causes them to be evaluated and run. - Chris Sent from my iPod On Sep 12, 2008, at 12:36 PM, byron <[EMAIL PROTECTED]> wrote: I am reading o'reilly's learning python (great book), but i came acro

Re: book example confusion

2008-09-12 Thread Bruno Desthuilliers
byron a écrit : I am reading o'reilly's learning python (great book), but i came across an example (pg 291, pdf) that I am not quite understanding the reasoning for the author's explanation: if f1() or f2(): The author states that do to the nature of that expression, if f1() returns True, f2()

book example confusion

2008-09-12 Thread byron
I am reading o'reilly's learning python (great book), but i came across an example (pg 291, pdf) that I am not quite understanding the reasoning for the author's explanation: if f1() or f2(): The author states that do to the nature of that expression, if f1() returns True, f2() will not be evalua