Why Python allows comparison of a callable and a number?

2009-11-22 Thread 一首诗
I used python to write an assignment last week, here is a code snippet # def departTime(): ''' Calculate the time to depart a packet. ''' if(random.random 0.8): t = random.expovariate(1.0 / 2.5) else: t = random.expovariate(1.0

Re: Why Python allows comparison of a callable and a number?

2009-11-22 Thread Chris Rebert
On Sun, Nov 22, 2009 at 4:03 AM, 一首诗 newpt...@gmail.com wrote: I used python to write an assignment last week, here is a code snippet # def departTime():    '''    Calculate the time to depart a packet.    '''    if(random.random 0.8):        t =

Re: Why Python allows comparison of a callable and a number?

2009-11-22 Thread MRAB
一首诗 wrote: I used python to write an assignment last week, here is a code snippet # def departTime(): ''' Calculate the time to depart a packet. ''' if(random.random 0.8): t = random.expovariate(1.0 / 2.5) else: t =