Is time.time() < time.time() always true?

Gabriel Genellina gagsl-py at
Wed Nov 22 01:41:07 CET 2006

At Tuesday 21/11/2006 20:10, flamesrock wrote:

>The question was, is the statement:
>time.time() < time.time()
>always true? Seems it should be false, since the statement itself
>occurs at one time instant.. but of course we know that python doesn't
>execute code that way.. So my question is, why doesn't Python work this

The only thing Python can guarantee, is that the left expression is 
evaluated before the right one (5.13 Evaluation order, Language Reference).

Then, whether the first call yields a result always less (or equal) 
to the second, is out of Python scope (and control).
(They might be equal if both calls get the same quantum of time; they 
might be reversed if some other process sets the time in the past).

Gabriel Genellina
Softlab SRL 

Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
¡Abrí tu cuenta ya! -

More information about the Python-list mailing list