[Python-Dev] datetime nanosecond support (ctd?) (original) (raw)

Antoine Pitrou solipsis at pitrou.net
Thu Dec 11 20:23:56 CET 2014


I think strftime / strptime support is a low-priority concern on this topic, and can probably be discussed independently of the core nanosecond support.

Regards

Antoine.

On Thu, 11 Dec 2014 11:14:27 -0800 Guido van Rossum <guido at python.org> wrote:

Another issue to consider here is that parsing and printing should be symmetrical. The %f format gobbles up exactly 6 digits.

Finally, strptime and strftime are not invented by Python, the same functions with (mostly) the same format characters are defined by other languages. Is there not a single other language that has added support for nanoseconds to its strftime/strptime? (I wouldn't be surprised if there wasn't -- while computer clocks have a precision in nanoseconds, that doesn't mean they are that accurate at all (even with ntpd running). On Thu, Dec 11, 2014 at 10:33 AM, Skip Montanaro <skip.montanaro at gmail.com> wrote: > On Thu, Dec 11, 2014 at 11:58 AM, Matthieu Bec <mdcb808 at gmail.com> wrote: > > ...or keep using "%f" if acceptable... > > That might be a problem. While it will probably work most of the time, > there are likely to be situations where the caller assumes it > generates a six-digit string. I did a little poking around. It seems > like "%N" isn't used. > > Skip _> ________________________ > Python-Dev mailing list > Python-Dev at python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > https://mail.python.org/mailman/options/python-dev/guido%40python.org >



More information about the Python-Dev mailing list