[Python-Dev] proposal: add basic time type to the standard library (original) (raw)

Tim Peters tim.one@comcast.net
Fri, 08 Feb 2002 15:47:28 -0500


[Guido]

I'm notoriously bad at channeling Jim. Nevertheless, I do recall him saying he wanted a lightweight time object.

Given that most mallocs align to 8-byte boundaries these days (also true of pymalloc), it's impossible in reality to define a smaller object than TimeStamp, provided it needs at least one byte of info beyond PyObject_HEAD.

I think the mistake of DateTime is that it stores the broken-out info, rather than computing it on request.

Possibly, but hard to say, since speed of display is also an issue, and I imagine also speed of range searches. At least 2.2 makes it easy to define computed attributes, any of which could choose to cache their ultimate value, but none of which would need to be stored in pickles.