[issue15443] datetime module has no support for nanoseconds

Tim Peters report at bugs.python.org
Tue Jul 15 04:53:41 CEST 2014


Tim Peters added the comment:

Of course pickles come with overheads too - don't be tedious ;-)  The point is that the guts of the datetime pickling is this:

basestate = PyBytes_FromStringAndSize((char *)self->data,
                                       _PyDateTime_DATETIME_DATASIZE);

That consumes exactly 10 bytes today.  Add nanoseconds, and it will take at least 11 (if 4 bits are insanely squashed into the bytes currently devoted to microseconds), and more likely 12 (if nanoseconds are sanely given their own 2 bytes).  I suppose another possibility is to get rid of microseconds internally, and work with a single 4-byte nanosecond member.

----------

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


More information about the Python-bugs-list mailing list