STINNER Victor added the comment:

And now, something completly different.

nanosec-wip.patch is a work-in-progress patch to use a unified (64 bits) 
integer type to store a timestamp: _PyTime_t. The type is written to be opaque, 
the unit is undefined, you must use functions to convert from and to this type. 
Well, in fact it's just a number of nanoseconds.

The patch is large:

 Include/pytime.h          |  125 ++++++-----
 Modules/_datetimemodule.c |   43 ++--
 Modules/_testcapimodule.c |   25 +-
 Modules/_threadmodule.c   |  156 +++++++-------
 Modules/gcmodule.c        |   12 -
 Modules/posixmodule.c     |   29 +-
 Modules/selectmodule.c    |   33 ---
 Modules/signalmodule.c    |   20 -
 Modules/socketmodule.c    |  151 ++++++++------
 Modules/socketmodule.h    |    2 
 Modules/timemodule.c      |   40 ++-
 Python/pytime.c           |  480 +++++++++++++++++++++++++++++-----------------
 12 files changed, 645 insertions(+), 471 deletions(-)

Conversion functions require a rounding mode.

I didn't update all tests yet. For example, test_datetime crash, test_time and 
test_threading fail. There are also 3 remaining FIXME for myself in pytime.c.

----------
Added file: http://bugs.python.org/file36538/nanosec-wip.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22117>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to