[issue23084] Expose C struct timespec (nanosecond resolution) in time module

mdcb report at bugs.python.org
Fri Dec 19 00:52:15 CET 2014


mdcb added the comment:

I'm going to be my own devil's advocate:

PyLong_FromLong

...

Thanks for all the links, I hadn't realized there was so much background to the issue, there is some good reading there too.
you've changed the title now, but in fact the intention was the other aspect, core nanosecond support in python. I just happened to pick timespec because it does the job and is reasonably widespread.

reading all this, and threading lighlty, I was playing with

class timestamp(int): pass
  """measure of time expressed as a number of nanoseconds"""

but that seems to loose the type information after doing arithmetics

x=timestamp(10)
y=timestamp(20)
type(x+y) gives <int>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23084>
_______________________________________


More information about the Python-bugs-list mailing list