Guido van Rossum wrote: > > > http://effbot.org/ideas/time-type.htm > > > > I can produce PEP and patch if necessary. > > Yes, a PEP, please! Jim Fulton has been asking for this for a long > time too. His main requirement is that timestamp objects are small, > both in memory and as pickles, because Zope keeps a lot of these > around. I also need time-zone support. > They are currently represented either as long ints (with a > little under 64 bits) or as 8-byte strings. ZODB has a TimeStamp type that uses a 32-bit unsigned integer to store year, month,, day, hour, and minute in a way that makes it dirt simple to extract a component. It uses a 32-bit integer to store seconds in units of 60/2**32 seconds. This type isn't appropriate for general use because it only allows dates later than Dec 31, 1899. > A dedicated timestamp > object could be smaller than that. A type that only needed minute precision could easily be expressed with 32-bits. Of course, the two-word object overhead makes the difference between 32-bits and 64-bits rather unexciting. > Your idea of a base type (which presumably standarizes at least one > form of representation) sounds like a breakthrough that can help > satisfy different other needs. I agree. Jim -- Jim Fulton mailto:jim@zope.com Python Powered! CTO (888) 344-4332 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4