[Python-Dev] Re: Adding a Rational Type to Python

Guido van Rossum guido@digicool.com
Mon, 12 Mar 2001 09:57:31 -0500


> > Question: the time module's time() function currently returns a
> > float.  Should it return a rational instead?  This is a trick question.
> 
> It should return the most exact number the underlying operating system
> supports. For example, in OSes supporting gettimeofday, return a rational
> built from tv_sec and tv_usec.

I told you it was a trick question. :-)

Time may be *reported* in microseconds, but it's rarely *accurate* to
microseconds.  Because the precision is unclear, I think a float is
more appropriate here.

--Guido van Rossum (home page: http://www.python.org/~guido/)