[Python-Dev] datetime nanosecond support
vincenzo.ampolo at gmail.com
Wed Jul 25 02:58:34 CEST 2012
This is the first time I write to this list so thank you for considering
this message (if you will) :)
I know that this has been debated many times but until now there was no
a real use case. If you look on google about "python datetime
nanosecond" you can find more than 141k answer about that. They all say
that "you can't due to hardware imprecisions" or "you don't need it"
even if there is a good amount of people looking for this feature.
But let me explain my use case:
most OSes let users capture network packets (using tools like tcpdump or
wireshark) and store them using file formats like pcap or pcap-ng. These
formats include a timestamp for each of the captured packets, and this
timestamp usually has nanosecond precision. The reason is that on
gigabit and 10 gigabit networks the frame rate is so high that
microsecond precision is not enough to tell two frames apart.
pcap (and now pcap-ng) are extremely popular file formats, with millions
of files stored around the world. Support for nanoseconds in datetime
would make it possible to properly parse these files inside python to
compute precise statistics, for example network delays or round trip times.
More about this issue at http://bugs.python.org/issue15443
I completely agree with the YAGNI principle that seems to have driven
decisions in this area until now but It is the case to reconsider it
since this real use case has shown up?
Thank you for your attention
More information about the Python-Dev