On Mon, Jul 13, 2009 at 03:28:29PM -0500, Tom Mueller (pkg-discuss) wrote:
> I'm curious what happens in Python for this line:
>
> if self.__seconds_xfr == 0:
>
> Is the self.__seconds_xfr converted to an int with integer comparison to  
> follow?  Or is the 0 converted to a float with float comparison to  
> follow?  If is the former, would this result in 0.0 being returned for  
> transfers that take less than a second?

I tested this in the interpreter before putting the code in the module.

>>> x = 0.0
>>> if x == 0:
...     print "True!"
... 
True!
>>> if x == 0.0:
...     print "True!"
... 
True!

Both of these cases appear to be equivalent.

-j
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to