This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lemburg
Recipients amaury.forgeotdarc, belopolsky, brett.cannon, brian.curtin, daniel.urban, davidfraser, eric.araujo, giampaolo.rodola, lemburg, mark.dickinson, pitrou, r.david.murray, rhettinger, techtonik, tim.peters, vstinner
Date 2010-08-06.07:44:16
SpamBayes Score 2.25708e-13
Marked as misclassified No
Message-id <1281080659.86.0.965183974159.issue9528@psf.upfronthosting.co.za>
In-reply-to
Content
> I believe _time module should become the home of the gettimeofday() method and pure python implementation of time.time() will be
> 
> def time()
>    s, us = _time.gettimeofday()
>    return s + 1e-6 * us
> 
> 
> Similarly time.sleep() can be implemented in terms of lower level POSIX nanosleep() method.
> 
> Lower level localtime() function can provide access to tm_zone and tm_gmtoff members of struct tm (where available) without concerns about backward compatibility.

Just for understanding:

Why are you calling the ticket "*Add* pure Python implementation of time
module to CPython" when you appear to be after *replacing* the C
implementation of the time module with a Python version ?

The same argument as for the datetime module applies: you can *add*
a compatible Python version of the same module for other Python
implementations to use, but undoing the work that has been done
in order to provide a faster implementation of the Python version
is a no-go.

Both datetime and time module functionalities need to be as fast as
possible, since they are used a lot in Python code. That was the
main reason for having a C implementation of the datetime and time
modules.

Python C function calls are still a lot faster than Python function
calls. You can't just replace a C function call with a Python one
without taking this into account. For these modules, it's not just
the API compatibility that matters, performance is just as
relevant and I don't really see a point in making CPython slower
just to make maintenance of stdlib modules that are not needed by
CPython easier.
History
Date User Action Args
2010-08-06 07:44:20lemburgsetrecipients: + lemburg, tim.peters, brett.cannon, rhettinger, amaury.forgeotdarc, mark.dickinson, davidfraser, belopolsky, pitrou, vstinner, techtonik, giampaolo.rodola, eric.araujo, r.david.murray, brian.curtin, daniel.urban
2010-08-06 07:44:19lemburgsetmessageid: <1281080659.86.0.965183974159.issue9528@psf.upfronthosting.co.za>
2010-08-06 07:44:17lemburglinkissue9528 messages
2010-08-06 07:44:16lemburgcreate