Author belopolsky
Recipients Arfrever, belopolsky, ethan.furman, lemburg,, vstinner
Date 2014-12-19.01:26:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
"nanosecond support [in Python]" is a PEP-size topic.  As Victor suggested, "If you are motivated enough, you may update the PEP and write a new one."  The tracker does not provide a sufficiently large forum to discuss "nanosecond support" in full generality.

>assuming it worked, this would somewhat be more agreeable ?

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

By "working", I assume you mean "if arithmetic operations worked as expected."  In this case you are reinventing mxDateTime [1], which is similar to stdlib datetime, but supports a much higher resolution.

> Ref. to PEP410 rejection and de facto standard seems a bit expeditive.

I don't think so.  Possibly, I should have referred to PEP 20, as well, but that is usually implicit.  We now have two APIs in stdlib that pass nanosecond-resolution timestamps as plain integers: os.stat() and os.utime().  This is not going to change, so for compatibility reasons, any new type would have to be interchangeable with int.  In theory, your timestamp subclass would qualify, but what advantage would it give you over plain int?  If you start adding functionality to timestamp, you will quickly end up with something that is half-way between int and either datetime or timedelta.

Date User Action Args
2014-12-19 01:26:17belopolskysetrecipients: + belopolsky, lemburg, vstinner, Arfrever, ethan.furman,
2014-12-19 01:26:16belopolskysetmessageid: <>
2014-12-19 01:26:16belopolskylinkissue23084 messages
2014-12-19 01:26:13belopolskycreate