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 belopolsky
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.04:33:15
SpamBayes Score 2.27041e-14
Marked as misclassified No
Message-id <>
The original RFE at issue 7989 was:

After discussion on numerous issues, python-dev, and here at the PyCon sprints, it seems to be a good idea to move timemodule.c to _timemodule.c and convert as much as possible into pure Python. The same change seems good for datetime.c as well.

See msg99774.  I have changed issue 7989 to cover datetime only because I argued that as a thin wrapper around C library calls, this module is an exception to the general rule that pure python implementations are a good idea.  See msg107303.

No I realize that in order to break circular dependency between time and datetime modules, it will be helpful to create an _time module that would provide lower than time module access to system facilities and datetime and time modules would be use _time module to implement higher level interfaces either in C or in Python.

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.
Date User Action Args
2010-08-06 04:33:24belopolskysetrecipients: + belopolsky, lemburg, tim.peters, brett.cannon, rhettinger, amaury.forgeotdarc, mark.dickinson, davidfraser, pitrou, vstinner, techtonik, giampaolo.rodola, eric.araujo, r.david.murray, brian.curtin, daniel.urban
2010-08-06 04:33:23belopolskysetmessageid: <>
2010-08-06 04:33:20belopolskylinkissue9528 messages
2010-08-06 04:33:16belopolskycreate